#K73107. Count Palindromic Words
Count Palindromic Words
Count Palindromic Words
You are given a string s containing one or more words separated by spaces. Your task is to count how many of these words are palindromic.
A word is considered a palindrome if it reads the same forwards and backwards. Mathematically, a word w is a palindrome if \(w = \text{reverse}(w)\). Note that the comparison is case sensitive: for example, madam
is a palindrome whereas Hello
is not.
Print the total number of palindromic words found in the input string.
inputFormat
The input consists of a single line containing the string s.
Read the input from stdin.
outputFormat
Output a single integer representing the count of palindromic words in the input string.
Write your output to stdout.
## samplemadam arora teaches malayalam
3