#C72. Case Insensitive Document Search

    ID: 51044 Type: Default 1000ms 256MiB

Case Insensitive Document Search

You are given a list of documents and a search string. Your task is to count the number of documents that contain the search string at least once. The search should be performed in a case-insensitive manner.

The input starts with an integer \( n \) which denotes the number of documents, followed by \( n \) lines each containing a document. The last line of the input is the search string. Your program should output a single integer that represents the number of documents containing the search string.

Note: For checking in each document, you may convert both the document and the search string to lowercase and then check if the search string appears as a substring in the document.

inputFormat

The first line contains an integer \( n \), the number of documents.

This is followed by \( n \) lines, each containing a single document (string).

The last line contains the search string.

Example:

3
Hello World!
Programming is fun.
hello there!
hello

outputFormat

Print a single integer representing the number of documents that contain the search string in a case-insensitive manner.

Example:

2
## sample
1
Hello World!
hello
1