wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def pali(s):
	l=s[::-1]
	if(l==s):
		return True
	else:
		return False
x=raw_input()
c=0
for i in range(1,len(x)):
	for j in range(0,len(x)-i+1):
		if(pali(x[j:j+i])==True):
			c+=1
print c