Death Knight Hero#6022

Death Knight Hero

1 second
64 megabytes
Very easy

There once was a champion of WoW

Arthasdk the name he was bestowed

He Death Gripped you to his side

His Chains of Ice stopped your stride

And Obliterates made you say "OWW!"

But one day our hero got puzzled

His Death Grip totally zzled

In his darkest despair

He could barely hear

"OMG NOOB u Chains of Iced than u Death Gripped"

Input

You are given a recording of the abilities our hero used in his battles.

The first line of input contains a single integer (1 \leq n \leq 100), the number of battles our hero played.

Then follow lines, each containing a sequence of k_i (1 \leq k_i \leq 1000) characters. Each character is either 'C', 'D', or 'O', which denote the abilities used by our hero in the -th battle. 'C' is Chains of Ice, 'D' is Death Grip, and 'O' is Obliterate.

Output

Output the number of battles our hero won, assuming he won each battle where Chains of Ice was not immediately followed by Death Grip.

Examples

Example 1

Loading
Loading