Palindromes
Medium
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
A string is called a palindrome if it reads the same from left to right and from right to left. For example, the string "abba" is a palindrome, while "omax" is not. A substring of string from position to position inclusive (positions are numbered from ) will be denoted as . The length of such a substring is .
For the given string of length , find the number of pairs such that and the substring is a palindrome.
Input
The input consists of a string of length , composed of lowercase Latin letters.
Output
Print the number of required pairs .
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #3
Answer #3
Submissions 735
Acceptance rate 16%