Line counter

Write a code to count the number of lines in a text that contain a given word.

Input

Input is formed by a word ww in the first line, followed by a text in subsequent input lines; these lines are formed by space-separated words.

Output

The number of lines in the text that have ww as one of their words.

Problem information

Author: Jorge Castro

Generation: 2026-01-25T17:42:08.572Z

© Jutge.org, 2006–2026.
https://jutge.org