Line counter X68325


Statement
 

pdf   zip

html

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

Input

Input is formed by a word w 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 w as one of their words.

Public test cases
  • Input

    table
    chair carpet glass
    table window
    window lamp carpet bottle
    armchair table table table
    

    Output

    2
    
  • Information
    Author
    Language
    English
    Official solutions
    Python
    User solutions
    Haskell Python