wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

s=str(raw_input())
count=0
for i in range(len(s)):
	for j in range(len(s)):
		p=s[i:j+1]
		q=p[::-1]
		if p==q and p!="":
			count=count+1
print count