#K54777. Keyword Occurrence Counter

    ID: 29829 Type: Default 1000ms 256MiB

Keyword Occurrence Counter

Keyword Occurrence Counter

You are given a review text along with a keyword. Your task is to count the number of times the exact keyword appears in the review.

Note:

  • The review is a string that may include punctuation.
  • The keyword should match exactly one of the tokens obtained by splitting the review on whitespace.
  • Case sensitivity matters.

For example, if the review is "The product is great. The product is worth the money." and the keyword is "product", then the output should be 2.

inputFormat

The input consists of two lines. The first line is the review text and the second line is the keyword to search for.

outputFormat

Output a single integer, which is the count of occurrences of the exact keyword in the review.## sample

The product is great. The product is worth the money.
product
2