wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

s=raw_input()

n=len(s)
m=1
count=0
while(n>=m):
	i=0
	while(i<n-(m-1)):
		sr=s[i:i+m]
		if(sr==sr[::-1]):
			count+=1		
		i+=1
	m+=1
	
print(count)