input() s=input() print(sum([s[j:i]==s[j:i][::-1]for i in range(1,len(s)+1)for j in range(i)]))