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