wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

'''
# Read input from stdin and provide input before running code

name = raw_input('What is your name?\n')
print 'Hi, %s.' % name
'''
s=raw_input()
count=0
for i in xrange(1,len(s)):
	for j in xrange(0,len(s)-i+1):
		a=s[j:j+i]
		b=s[j:j+i][::-1]
		if a==b:
			count+=1
			
print count