Time limit: 2.0s
Memory limit: 128M
items. To save space, he records the -th item as a string, , on his checklist. He has upcoming assignments, the -th of which requires items to complete, . If has all required items, he can complete the -th assignment. Otherwise, he flunks it. Help him determine how many assignments he can complete!has spent the weekend hastily preparing DMOPC problems! Unfortunately, he is now behind on several assignments. After rummaging through his backpack, he realizes that he has
In all subtasks,
where denotes the length of string
The first line contains two space-separated integers, and .
The next lines contain a single string, . It is guaranteed that all the strings will be unique.
The next sections contain a single integer , followed by lines each containing a single string, .
Output a single integer on a single line, the answer to the problem.
3 4 chalk cheese charger 1 cheese 2 coins cash 3 charger chalk caffeine 3 cheese charger cheese