wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def palindrome(string):
	return string == string[::-1]
def substring_split(string):
	length = len(string)
	count = 0
	for j in range(length):
		for i in range(length-j):
			if palindrome(string[j:length-i]):
				count += 1
	return count
string = raw_input()
print substring_split(string)