#C7506. Count Palindromic Words
Count Palindromic Words
Count Palindromic Words
You are given a string, and your task is to count the number of palindromic words it contains. A word is considered palindromic if it reads the same forwards and backwards. Before checking, you must convert the entire string to lower-case and remove all punctuation.
For example, consider the input:
A man, a plan, a canal, Panama!
After processing, this string yields 3 palindromic words.
Note: A word consisting of a single character is considered a palindrome.
inputFormat
The input consists of a single line which is a string. The string may contain letters, punctuation, and spaces.
outputFormat
Output a single integer denoting the number of palindromic words in the input string.
## sampleHello world
0