LCC '22 Contest 6 J2 - Imagine APs

View as PDF

Submit solution

Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type

After the cancer that was AP statistics, Max decided that he isn't doing any APs this year. His close friend, Shane, however, has enrolled in AP Calculus BC and AP Statistics, and hasn't begun studying for either.

Max knows Shane wants 5s in both APs, and he will try his best to make this not a reality. He discovers that when Shane is studying, there are N phrases he can text him on Discord that will distract Shane and make him disregard his APs and text with him instead.

Today, Max decides to text Shane T messages on Discord. Determine the number of times Shane will get distracted!


1 \le N \le T \le 10^5

Each phrase and text message is guaranteed to be less than 100 characters long.

Input Specification

The first line will contain two integers, N and T.

The next N lines will contain a string of characters, one of the phrases.

The next T lines will contain a string of characters, a text that Max sends to Shane.

Output Specification

Output one integer, the number of times that Shane will get distracted by Max's texts.

Sample Input

2 4
shane chen
shane chen
me with accounting

Sample Output



There are no comments at the moment.