A string is called a palindrome if it reads the same forwards and backwards. For example, abba is a palindrome, while omax is not. For a given string , we denote by its substring starting at the -th position and ending at the -th position (inclusive), with length j - i + 1, where positions are numbered starting from .
Given a string of length (1 \leq n \leq 5\,000\,000), determine the number of pairs with 1 \leq i < j \leq n such that the substring is a palindrome.
The input consists of a single string of length , consisting of lowercase Latin letters.
Output the number of such pairs.
Example 1
Example