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 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())