wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

a=[[] for i in range(26)]
s=raw_input()
for i in range(len(s)):
	a[ord(s[i])-ord('a')].append(i)
c=0
for i in range(26):
	for j in range(len(a[i])):
		for k in range(j,len(a[i])):
			q=s[a[i][j]:a[i][k]+1]
			if q==q[::-1]:
				c+=1
print c