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

A = [None]*k

for i in range(k):

    d = int(eval(input()))

    A[i] = list(map(int, input().split()))



sunuke = [0] * n

for i in range(k):

    for j in A[i]:

        sunuke[j - 1] += 1



ans = 0

for i in sunuke:

    if i == 0:

        ans += 1

print(ans)

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

A = [None]*k

for i in range(k):

    d = int(eval(input()))

    A[i] = list(map(int, input().split()))



snuke = [0] * n

for i in range(k):

    for j in A[i]:

        snuke[j - 1] += 1



ans = 0

for i in snuke:

    if i == 0:

        ans += 1

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

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

-sunuke = [0] * n +snuke = [0] * n -        sunuke[j - 1] += 1 +        snuke[j - 1] += 1 -for i in sunuke: +for i in snuke: