wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def isPalindrome(a):
    if a==a[::-1]:
        return True
    return False

s=raw_input()
l=len(s)
c=l
if isPalindrome(s):
    c+=1
for i in range(l-1):
    for j in range(i+1,l):
        if isPalindrome(s[i:j+1]):
            c+=1

print c