wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

# Palindrome count
def get_all_substrings(string):
    length = len(string)
    for i in xrange(length):
        for j in xrange(i + 1, length + 1):
            yield(string[i:j])
s=raw_input()
sub_list=list(get_all_substrings(s))
count=0
for sub in sub_list:
    if sub==sub[::-1]:
        count+=1
print count