wa in abcstr

#include<string.h>
#include <stdio.h>

int main()
{
   long long int m,n,s=0,a=0,b=0,c=0,i,j,k;
    char arr[1000000],ch;
    scanf("%s",arr);
    m=strlen(arr);
   	if((m%3)==0)
      	n=m;
   	else if(((m-1)%3)==0)
   	n=m-1;
   	else
   	n=m-2;
   	
   	for(i=3;i<=n;i=i+3)
   	{
   	
   		for(j=0;j<=m-i;j++)
   		{
   			k=i;
		   while(k!=0)
		   {
		   	ch=arr[(j+k-1)];
   			if(ch=='a')
   			a++;
   			else if(ch=='b')
   			b++;
   			else 
   			c++;
   			k--;
   	       }
   	       
   	    	if((a==b)&&(b==c)&&(c==a))
   	    	s++;
   	    	a=0;
   	    	b=0;
   	    	c=0;
   		}
		   
		   	
   	}
   	printf("%lld",s);
    return 0;
}

Aren’t they supposed to be capital ?