eolymp
bolt
Try our new interface for solving problems
Məsələlər

Смерть рыцаря героя

Смерть рыцаря героя

\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 У Вас имеется набор способностей нашего героя, которые он использует в своих сражениях. Первая строка содержит количество битв \textbf{n} (\textbf{1} ≤ \textbf{n} ≤ \textbf{100}) героя. Следующие \textbf{n} строк содержат последовательность \textbf{k_i} (\textbf{1} ≤ \textbf{k_i} ≤ \textbf{1000}) символов, каждый из которых '\textbf{C}', '\textbf{D}' или '\textbf{O}'. Они обозначают способности, используемые героем в \textbf{i}-ой битве. '\textbf{C}' - Ледяные Оковы, '\textbf{D}' - Хватка Смерти, а '\textbf{O}' - Уничтожение. \OutputFile Вывести количество выигранных боев. Считайте, что герой выигрывает бой, если только за Ледяными Оковами не следует непосредственно Хватка Смерти.
Zaman məhdudiyyəti 1 saniyə
Yaddaşı istafadə məhdudiyyəti 64 MiB
Giriş verilənləri #1
3
DCOOO
DODOCD
COD
Çıxış verilənləri #1
2
Mənbə 2011 Nordic Collegiate Programming Contest, 1 Октября, Задача С