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

A = set([])



for i in range(k):

    d = eval(input())

    A = A | set(map(int, input().split()))



ans = 0

for i in range(n):

    if i+1 not in A:

        ans += 1

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

A = set([])



for i in range(k):

    d = eval(input())

    A = A | set(map(int, input().split()))



print((n-len(A)))
n, k = list(map(int, input().split()))
A = set([])
for i in range(k):
    d = eval(input())
    A = A | set(map(int, input().split()))
ans = 0
for i in range(n):
    if i + 1 not in A:
        ans += 1
print(ans)

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

-ans = 0 -for i in range(n): -    if i + 1 not in A: -        ans += 1 -print(ans) +print((n - len(A)))