BeginnerDictionaries2000 ms256 MB
Word Frequency
Count how many times a target word appears in a sentence.
Statement
Count how many times a target word appears in a sentence.
Input
First line: target word. Second line: a sentence of lowercase words.
Output
One integer count.
Constraints
- The sentence has at most 100 words.
Examples
Example 1
Input
code
code with care and code with purposeOutput
2The target appears twice.
Sample runs use visible examples. Full submissions are checked securely on the server, and private test cases are not shown in the browser.