wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def isPal(s):
	l=list(s)
	p=list(reversed(l))
	if(l==p):
		return True
	else:
		return False
s=raw_input()
cnt=0
for i in range(1,len(s)):
	for j in range(0,(len(s)-i)+1):
		
		if(isPal(s[j:j+i])==True):
			cnt=cnt+1
print (cnt)