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
'''
#print 'Hello World!'


s= raw_input();
res=0;
for i in range (0,len(s)):
	for j in range (i+1,len(s)+1):
		if ( s[i:j] == s[i:j][::-1] ):
			res+=1;

print res;