Problem: Given a string S, count the number of non empty sub strings that are palindromes.
A sub string is any continuous sequence of characters in the string.
A string is said to be palindrome, if the reverse of the string is same as itself.
Two sub strings are different if they occur at different positions in S

Input
Input contains only a single line that contains string S.   

Output
Print a single number, the number of sub strings that are palindromes.

Constraints
1 ≤ |S| ≤ 50
S contains only lower case latin letters, that is characters a to z.

SAMPLE INPUT
dskjkd

SAMPLE OUTPUT
7

Explanation

The 7 sub strings are d, s, k, j, k, d, kjk.

Solution (in PYTHON):

Solution:
def isPalindrome(s):
  lf = 0
  ri = len(s)-1
  while lf <= ri:
    if s[lf] != s[ri]:
      return 0
    lf += 1
    ri -= 1
  return 1

def getPalindromes(s):
  palindromes = []
  lf = 0
  ri = len(s)
  while lf <= ri:
    subri = lf+1
    while subri <= ri:
      t = s[lf:subri]
      if isPalindrome(t):
        palindromes.append(t)
      subri += 1
    lf += 1
  return palindromes


print len(getPalindromes(raw_input()))