wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

s=raw_input()
count=0
for i in range(0,len(s)):
	for j in range(i+1,len(s)+1):
		temp=s[i:j]
		rev=temp[::-1]
		if rev==temp:
			count+=1
print count