Thornhill Computer Club 2024 - February Mock CCC - Problem 2
is climbing up a mountain. Unfortunately he tripped over a rock and is now tumbling down! As he falls, he hits rocks on the way down and each time he does, he screams "OUCH". finds 's predicament extremely funny and decides to record the audio. Watching the file back, determine how many times hit a rock while falling.
Input Specifications
The first and only line of input will consist of a single string of length between to alphanumeric characters.
Output Specifications
Output a single integer representing the number of times
hit a rock (how many times the string has the word "OUCH").Sample Input 1
OUCHOUCHOUCH
Sample Output 1
3
Explanation for Sample Output 1
The word "OUCH" can be found 3 times in the given string. This implies that 3
.
Sample Input 2
OUCHOUOUCHKNJGBKRBG
Sample Output 2
2
Explanation for Sample Output 2
The string "OUCH" can only be found twice in the given string as
begins to spout gibberish afterwards.
Comments