Hints:
If you use cin and then getline. The getline will only get the end of line right after the character $C$. Please use getline again to really get the string $S$.
Rock has given you a string $S$ for your birthday present. Count the number of occurrences of the specified character $C$ in the string $S$.
Input
The first line of input contains the character $C$.
The second line of input contains the string $S$.
Output
Output the number of occurrences of $C$ in $S$.
Constraints
$1 \le |S| \le 1000$ (where $|S|$ is the length of $S$).
$S$ will only contain English letters and whitespace characters.
$C$ is an English letter.
Sample Test Cases
Input | Output | |
---|---|---|
o Wah Yan College Kowloon |
4 |
Scoring: Per Subtask
Authored by s16f22
Appeared in 2024 Mini Contest 1