wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def lpc(s):
    if not s:
        return 0
    elif len(s) == 1:
        return 1
    elif s == s[::-1]:
        return len(s)/2+lpc(s[:-1])
    else:
        return lpc(s[:-1])

def rpc(s):
    if not s:
        return 0
    elif len(s) == 1:
        return 1
    elif s == s[::-1]:
        return len(s)/2+rpc(s[1:])
    else:
        return rpc(s[1:])

def pc (s):
    if not s:
        return 0
    elif len(s) == 1:
        return 1
    elif s == s[::-1]:
        return len(s)/2    + lpc(s[:-1]) + rpc(s[1:])
    else:
        return pc(s[1:-1]) + lpc(s[:-1]) + rpc(s[1:])

print pc (raw_input())