cswork / OAOpen practice workspace

KoddiOA #1

Count Words Starting and Ending with Same Letter

Estimated EasyJudge-ready

Topics (AI-labelled)Strings

The text consists of English-letter words and spaces. Count the words whose first letter is the same as their last letter, ignoring case. For empty text, output 0.

The statement, the case rule, and the empty-string example are explicit; this site adds the line-based input protocol.

Input

A single line of text (possibly empty; at most 100000 characters), with words separated by one or more spaces.

Output

Output the number of qualifying words.

Example 1

Input:

Level Wow not now

Output:

2

Example 2

Input:

Output:

0

Example 3

Input:

A ab bB

Output:

2

Editorial

Loading solution…