#import int q,i,f,j;char s[999];main(){for(scanf("%*d%s",s);s[j=i/2];i++)for(f=1;~j;)q+=f*=s[j]==s[i-j--];printf("%d\n",q);}