n, k = map(int, input().split())
b = [0] * n
for _ in range(k):
    a = int(input())
    c = list(map(int, input().split()))
    for i in c:
        b[i - 1] = 1
print(b.count(0))

2ad7d6e885167beaefa0b6c01c913b1610442c35
<mask token>

<mask token>
for _ in range(k):
    a = int(input())
    c = list(map(int, input().split()))
    for i in c:
        b[i - 1] = 1
print(b.count(0))

n, k = map(int, input().split())
b = [0] * n
for _ in range(k):
    a = int(input())
    c = list(map(int, input().split()))
    for i in c:
        b[i - 1] = 1
print(b.count(0))
