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
'''
string=raw_input()

def count(string):
	if not string:return 0
	count=0
	for i in range(len(string)):
		for j in range(i,len(string)):
			if string[i:j+1]==string[i:j+1][::-1]:
				count+=1
	return count
     
print count(string)