#0000F9

z-palindromes

A PALINDROME is a string of one or more characters which is is the same when you read it either from left to right or from right to left. As a WORD we will consider consecutive string of digits or letters of english alphabet (either uppercase or lowercase). WORD is separated from another with one or more blank spaces or some interpunction signs (other characters which are neither digits nor letters).


InputFirst and only line on standard input have string of characters no bigger then 4 MB (4*2^20 characters). All the characters will be digits, letters or interpunction signs.

OutputTo the first and only line on standard output, you need to output one integer representing the number of PALINDROME WORDs in input data.


Input:
I'm excited with my dad's 111 solved problems on Z-trening!
Output:
6
Explanation: 6 palindromes here are "I", "m", "dad", "s", "111" and "Z".


Input:
Woow! My new user name here is 'Oduleludo' and password is 'MM666MM' but I will not give it anyone .
Output:
4
Explanation: 4 palindromes here are "Woow", "Oduleludo", "MM666MM" and "I".

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.