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



list_A = [0]*N

ans = 0

d = []

A = []



for i in range(K):

    d.append(int(eval(input())))

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



list_A = [0]*N



for i in range(len(A)):

    for j in A[i]:

        list_A[j-1] += 1

        

for i in range(N):

    if list_A[i] == 0:

        ans += 1

        

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

tmp_A = [0]*N

ans = 0



for i in range(K):

    d = int(eval(input()))

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

    for j in range(d):

        tmp_A[A[j]-1] += 1

        

for i in range(N):

    if tmp_A[i] == 0:

        ans += 1

        

print(ans)
N, K = list(map(int, input().split()))
list_A = [0] * N
ans = 0
d = []
A = []
for i in range(K):
    d.append(int(eval(input())))
    A.append(list(map(int, input().split())))
list_A = [0] * N
for i in range(len(A)):
    for j in A[i]:
        list_A[j - 1] += 1
for i in range(N):
    if list_A[i] == 0:
        ans += 1
print(ans)

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

-list_A = [0] * N +tmp_A = [0] * N -d = [] -A = [] -    d.append(int(eval(input()))) -    A.append(list(map(int, input().split()))) -list_A = [0] * N -for i in range(len(A)): -    for j in A[i]: -        list_A[j - 1] += 1 +    d = int(eval(input())) +    A = list(map(int, input().split())) +    for j in range(d): +        tmp_A[A[j] - 1] += 1 -    if list_A[i] == 0: +    if tmp_A[i] == 0: