Competitions

# ADA University - January 29

# Palindromes

Non-empty string containing a certain word is called palindrome if it reads the same from left to right and from right to left.

Let we are given a word **s**, consisting of **n** uppercase letters of Latin alphabet. Deleting from the word a certain set of characters, you can get the palindrome string. Find the number of ways to delete from the word some (possibly empty) set of symbols so that the resulting string is a palindrome. Ways in different order of deleting characters are considered equal.

#### Input

Contains one word **s** of length **n** (**1** ≤ **n** ≤ **60**).

#### Output

Print a single integer - the number of ways to delete.

Input example #1

BAOBAB

Output example #1

22