s=open(0).read().split()[1] a=0 for r in range(len(s)): for l in range(r+1): k=0 for d in range(l,r+1):k+=s[d]!=s[r-d+l] a+=k==0 print(a)