After a long and miserable day at work, Mirko decided to order a pizza for dinner to cheer himself up. In a big pile of papers on his desk, he found a flyer of a nearby pizza restaurant. The restaurant offers different pizzas. Pizza toppings are labeled with positive integers. pizza has toppings, with labels .
Mirko is very picky when it comes to food. He doesn't like toppings, those with labels , so he wants to order a pizza that doesn't contain any of those toppings. Determine the number of pizzas that Mirko can order.
Constraints
Subtask | Points | Constraints |
---|---|---|
1 | 20 | |
2 | 30 | No additional constraints. |
Input Specification
The first line contains an integer , the number of toppings, followed by distinct integers , the labels of toppings Mirko dislikes.
The second line contains an integer , the number of pizzas.
The following lines describe the pizzas. The line contains an integer , the number of toppings, followed by distinct integers , the labels of toppings on the pizza.
The pizzas, i.e. the sets of toppings, will be distinct.
Output Specification
Output the number of pizzas that Mirko can order.
Sample Input 1
1 2
3
1 1
1 2
1 3
Sample Output 1
2
Sample Input 2
2 1 2
4
2 1 4
3 1 2 3
2 3 4
3 3 5 7
Sample Output 2
2
Sample Input 3
1 4
3
1 1
1 2
1 3
Sample Output 3
3
Comments