wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

s = raw_input()
pal_count = 0
for a in range(len(s)):
	for b in range(a+1, len(s)+1):
		r = s[a:b]
		if r==r[::-1]:
			pal_count += 1
print pal_count