n, k = list(map(int, input().split()))

s = set()



for _ in range(k):

    d = int(eval(input()))

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

    for i in range(len(t)):

        s.add(t[i])





print((n - len(s)))

n, k = list(map(int, input().split()))



A = [-1] * n



for i in range(k):

    d = int(eval(input()))

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

    for j in range(d):

        x = a[j]-1

        if A[x] == -1:

            A[x] = 1



ans = 0



for i in range(n):

    if A[i] == -1:

        ans += 1



print(ans)

n, k = list(map(int, input().split()))
s = set()
for _ in range(k):
    d = int(eval(input()))
    t = list(map(int, input().split()))
    for i in range(len(t)):
        s.add(t[i])
print((n - len(s)))

n, k = list(map(int, input().split()))
A = [-1] * n
for i in range(k):
    d = int(eval(input()))
    a = list(map(int, input().split()))
    for j in range(d):
        x = a[j] - 1
        if A[x] == -1:
            A[x] = 1
ans = 0
for i in range(n):
    if A[i] == -1:
        ans += 1
print(ans)

-s = set() -for _ in range(k): +A = [-1] * n +for i in range(k): -    t = list(map(int, input().split())) -    for i in range(len(t)): -        s.add(t[i]) -print((n - len(s))) +    a = list(map(int, input().split())) +    for j in range(d): +        x = a[j] - 1 +        if A[x] == -1: +            A[x] = 1 +ans = 0 +for i in range(n): +    if A[i] == -1: +        ans += 1 +print(ans)