Super palindromes#470

Super palindromes

3 seconds
128 megabytes
Very easy

Let us call a string of length greater than one a palindrome if it reads the same from left to right and from right to left.

A superpalindrome is a string that can be represented as a concatenation of one or more palindromes.

Given a string , find the number of substrings of that are superpalindromes.

Input

One string s~(1 \le |s| \le 1000) consisting of lowercase Latin letters.

Output

Print one integer — the number of substrings of the string that are superpalindromes.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading