wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

s = raw_input()
tot = 0
length = len(s)
for i in xrange(length):
	for j in xrange(i+1,length):
		if s[i:j+1] == s[i:j+1][::-1]:
			tot += 1
print tot+length