wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

def getSeq(l):
    count = 0
    for i in xrange(len(l)):
            for j in xrange(i, len(l)):
                if l[i:j+1]==l[i:j+1][::-1]:
                    count += 1
    return count
    
print getSeq(raw_input())