Help me in solving CHEFSTUD problem in c

My issue

my code works
but its not passing just one case.

My code

#include <stdio.h>
#include<string.h>
int main() {
	// your code goes here
int t;
scanf("%d",&t);
getchar();
while(t--){
    char a[100000];
       fgets(a, sizeof(a), stdin);
       size_t b=strlen(a);
       if (b > 0 && a[b - 1] == '\n') {
            a[b - 1] = '\0';
            b--;
        }
      
       int i,count=0;
       for(i=0;i<b-1;i++){
           if(a[i]=='<'&&a[i+1]=='>'){
               count++;
              i++;
           }
         
       }
       printf("%d\n",count);
}
}


Learning course: Roadmap to 3*
Problem Link: https://www.codechef.com/learn/course/klu-roadmap-3star/KLURMP300A/problems/CHEFSTUD