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 and a list of 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 songnevergonnagiveyouup
.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
No string will be longer than characters.
Input Specification
The first line will contain and .
The next 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