wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def is_palindrome(S):
	if len(S) == 0:
		return False
	if len(S) == 1:
		return True
	for i in range(len(S)/2):
		if S[i] != S[-1-i]:
			return False
	return True
	
S = raw_input()
count = 0

for i, s in enumerate(S):
	for l in range(1, len(S)-i+1):
		if is_palindrome(S[i:i+l]):
			count +=1
print count