wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

# palindrome substrings

string = raw_input()
str_len = len(string)
palin_count = 0

for i in range(str_len) :
	left = i
	right = i
	while left >= 0 and right < str_len :
		if string[left] == string[right] : palin_count += 1
		else : break
		left -= 1
		right += 1
	
	left = i
	right = i + 1
	while left >= 0 and right < str_len :
		if string[left] == string[right] : palin_count += 1
		else : break
		left -= 1
		right += 1
		
print palin_count