Andriyirdna


Submit solution

Points: 100 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

Andrew loves palindromes(and the library stl). This is probably the only feature that sets him apart from all other lecturers.

One day he wondered how many substrings in his name are longer than one character and are also palindromes. You need to do it for him because Andrew has disappeared somewhere again.

Input Specification

The first line contains the string \(S\) \((1 \leq |S| \leq 10^5)\) which consists of lowercase Latin letters.

Output Specification

Print the number of substrings of the string \(S\), which are also palindromes longer than one character.

Sample Input 1

kak

Sample Output 1

1

Sample Input 2

hashahash

Sample Output 2

2

Comments

There are no comments at the moment.