Guess the Song

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Authors:
Problem type

With the new competitive programming season beginning, Shane comes up with another problem:

A song can be represented as a string of lowercase english letters.

You are given a sample of a song S and a list of N full songs. We say that this sample is potentially a song if the prefix of the song is equal to the sample.

For example, the sample nevergonna is potentially the full song nevergonnagiveyouup.

Determine the number of songs in the list that are potentially the song that the sample is.

Shane stumps himself yet again with his own problem. Please help him find a solution.

Constraints

1 \le N \le 100

No string will be longer than 100 characters.

Input Specification

The first line will contain N and S.

The next N lines will contain a string representing a song in the list.

Output Specification

Output one integer, the number of songs in the list that are potentially the song that the sample is.

Sample Input

4 nevergonna
nevergonnagiveyouup
alwaysgonnaletyoudown
nevergonnarunaround
desertyou

Sample Output

2

Comments

There are no comments at the moment.