wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

st = list(raw_input())
cnt = 0
flg = 0
sr = []
for i in range(len(st)):
	for j in range(i,len(st)):
		sr = st[i:j+1]
		flg=0
		if len(sr) == 1:
			cnt +=1
			continue
		for k in range(len(sr)/2):
			if sr[k] != sr[len(sr)-k-1]:
				flg = 1
				break
		if flg == 0:
			cnt+=1
			#print sr
print cnt