N, K = list(map(int, input().split()))

haves = [False for _ in range(N)]



def judge_Flag(flags):

    As = list(map(int, input().split()))

    for A in As:

        flags[A - 1] = True



for _ in range(K):

    people_num = int(eval(input()))

    judge_Flag(haves)

print((haves.count(False)))
N, K = list(map(int, input().split()))

haves = [False for _ in range(N)]

 

def judge_Flag(flags, num):

    As = list(map(int, input().split()))

    for i in range(num):

        flags[As[i] - 1] = True

        

for _ in range(K):

    people_num = int(eval(input()))

    judge_Flag(haves, people_num)

print((haves.count(False)))
N, K = list(map(int, input().split()))
haves = [False for _ in range(N)]


def judge_Flag(flags):
    As = list(map(int, input().split()))
    for A in As:
        flags[A - 1] = True


for _ in range(K):
    people_num = int(eval(input()))
    judge_Flag(haves)
print((haves.count(False)))

N, K = list(map(int, input().split()))
haves = [False for _ in range(N)]


def judge_Flag(flags, num):
    As = list(map(int, input().split()))
    for i in range(num):
        flags[As[i] - 1] = True


for _ in range(K):
    people_num = int(eval(input()))
    judge_Flag(haves, people_num)
print((haves.count(False)))

-def judge_Flag(flags): +def judge_Flag(flags, num): -    for A in As: -        flags[A - 1] = True +    for i in range(num): +        flags[As[i] - 1] = True -    judge_Flag(haves) +    judge_Flag(haves, people_num)