wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

string = raw_input("")
count = 0
for i in range(len(string)):
	for j in range(i+1, len(string)+1):
		if string[i:j] == string[i:j][::-1]:
			count += 1

print count