wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

ins = raw_input().strip()
cnt = 0
for x in range(len(ins)):
    for y in range(x, len(ins)):
        curr =  ins[x:y+1]
        if curr == curr[::-1] and curr != "":
            cnt += 1
            
print cnt