Every male competitive programmer knows that finding a prom date is both more competitive and more difficult than any programming competition. It's almost time for prom, but the CS nerd still doesn't have a prom date! Of course, he really wants to take the girl out. Unfortunately, he knows this won't happen, so he won't go to the event. Despite this, he is still interested in his options for prom.
There are males and females in the school. Each male is willing to go to prom with a non-negative number of females. Every student is given an identification number. Males are numbered from to and females are separately numbered from to . The CS nerd's ID number is (and he is a male).
Other males will always get to choose a single female for their prom date before the CS nerd does. Once a female is chosen, another male cannot choose her. Males will always try to choose one female they are willing to go to prom with, but this is not always possible. The CS nerd then wonders to himself: "What is the minimum number of females I can choose from?" Can you help him out?
In all subtasks:
The first line of input will contain two integers, and .
lines of input follow. The first integer will be . space-separated integers follow, specifying the ID numbers of the females the male is willing to go to prom with. All of the ID numbers on each line will be distinct.
Output the minimum number of females that the CS nerd can choose from.
Sample Input 1
2 2 1 1 2 1 2
Sample Output 1
Explanation for Sample Output 1
If male chooses female , the CS nerd cannot choose any female.
Sample Input 2
3 3 3 1 2 3 3 1 2 3 3 1 2 3
Sample Output 2
Sample Input 3
3 4 2 1 2 1 2 2 2 4
Sample Output 3