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

q = set([])

for _ in range(K):

    d = int(eval(input()))

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

    for i in range(d):

        q.add(tmp[i])



ans = N - len(q)



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

q = set([])

for _ in range(K):

    tmp = int(eval(input()))

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

    for a in A:

        q.add(a)



print((N - len(q)))
N, K = list(map(int, input().split()))
q = set([])
for _ in range(K):
    d = int(eval(input()))
    tmp = list(map(int, input().split()))
    for i in range(d):
        q.add(tmp[i])
ans = N - len(q)
print(ans)

N, K = list(map(int, input().split()))
q = set([])
for _ in range(K):
    tmp = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        q.add(a)
print((N - len(q)))

-    d = int(eval(input())) -    tmp = list(map(int, input().split())) -    for i in range(d): -        q.add(tmp[i]) -ans = N - len(q) -print(ans) +    tmp = int(eval(input())) +    A = list(map(int, input().split())) +    for a in A: +        q.add(a) +print((N - len(q)))