#0005AD

Number of Palindrome

You are given a string S. We want to know how many distinct substrings of S are palindromes.



InputEach test case consists of only one string S, whose length is less than 100000 and only contains lowercase letters.


OutputOutput the number of distinct substrings of S which are palindromes.



Sample Input 1:
aaaa
Sample Output 1:
4



Sample Input 2:
abab
Sample Output 2:
4



Sample Input 3:
abcd
Sample Output 3:
4

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.