wqc mygrlbiadhzlabefvjtghfrtydurkpmoveczbqzzlenezq
3
 48

import sys
"""def splitstring(s):
  result = [s]
  for i in range(1, len(s)):
    result.extend('%s %s' % (s[:i], x) for x in splitstring(s[i:]))
  return result"""


"""def  substrings(string):
    for substringLength in [1,2,...,string.length]:
        for start in range [0,1,...,string.length-substringLength]:
            yield string[start...(start+substringLength-1)]
    yield """""

l=[]
def substrings(string):
    for start in range(0,len(string)):
        for end in range(start,len(string)+1):
             l.append(string[start:end])
    return l



#x=raw_input("Enter String\n")
x=sys.stdin.readline().strip()
c=0
for i in substrings(x):
    if len(i)>0 and i==i[::-1]:
         c=c+1
        
print c