Problems
Death Knight Hero
Death Knight Hero
\includegraphics{https://static.e-olymp.com/content/a6/a6c51c1f72225bf570f77807c122a8a9841662c1.jpg}
There once was a champion of \textit{WoW}
\textit{Arthasdk} the name he was bestowed
He \textit{Death Gripped} you to his side
His \textit{Chains of Ice} stopped your stride
And \textit{Obliterates} made you say "OWW!"
But one day our hero got puzzled
His \textit{Death Grip} totally zzled
In his darkest despair
He could barely hear
"OMG NOOB u \textit{Chains of Iced} than u \textit{Death Gripped}"
\InputFile
You are given a recording of the abilities our hero used in his battles.
The first line of input will contain a single integer \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{100}), the number of battles our hero played.
Then follow \textbf{n} lines each with a sequence of \textbf{k_i} (\textbf{1} ≤ \textbf{k_i} ≤ \textbf{1000}) characters, each of which are either '\textbf{C}', '\textbf{D}' or '\textbf{O}'. These denote the sequence of abilities used by our hero in the \textbf{i}-th battle. '\textbf{C}' is \textit{Chains of Ice}, '\textbf{D}' is\textit{ Death Grip} and '\textbf{O}' is \textit{Obliterate}.
\OutputFile
Output the number of battles our hero won, assuming he won each battle where he did not \textit{Chains of Ice} immediately followed by \textit{Death Grip}.
Input example #1
3 DCOOO DODOCD COD
Output example #1
2