Spongebob and Patrick is watching Squidward play his clarinet so that they can learn and play for themselves. So that they can review later on, Patrick decided to take notes of the music squidward is playing. In order to take notes, patrick converts the music he hears to a string of characters (a-z).
When Spongebob reads the notes, he notices something very interesting. The notes that patrick writes contains a lot of palindromes and Spongebob suspects that this is the key to copying Squidward's beautiful music but just to be sure, he wants to count how many palindromes are in the string.
Palindromes is a set of words that are read the same when written forwards and backwards, however for this problem, palindromes that have 2 characters or less do not count.
For example the string elellal contains only 3 palindromes:
- ele
- lel
- lal
'll' does not count as a palindrome because it only has 2 characters.
Count how many palindromes are in a given string from patrick's notes.
Note: duplicate palindromes still count!
For example the string elele contains 4 palindromes:
- ele
- lel
- ele
- elele
A single string with length l (1 <= l <= 1000).
The number of Palindromes in the string followed by a newline character "\n".