LearnPy Hub
← Arena
IntermediateRating 1300

Count Palindromic Pieces

Count the substrings (consecutive pieces, counted by position) that read the same backwards.

Input

One string (length ≤ 2000).

Output

One integer.

Sample 1

Input
abc
Output
3

Sample 2

Input
aaa
Output
6
solution.py
Output appears here
Count Palindromic Pieces · Python Arena problem · LearnPy Hub