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

snuke = [0]*N

for i in range(K):

    d = int(eval(input()))

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



    for j in A:

        snuke[j-1] += 1

cnt = 0

for i in snuke:

    if i == 0:

        cnt += 1



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



snukes = [1]*N



for _ in range(K):

    d = int(eval(input()))

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



    for i in A:

        snukes[i-1] = 0



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

N, K = list(map(int, input().split()))
snukes = [1] * N
for _ in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for i in A:
        snukes[i - 1] = 0
print((sum(snukes)))

-snuke = [0] * N -for i in range(K): +snukes = [1] * N +for _ in range(K): -    for j in A: -        snuke[j - 1] += 1 -cnt = 0 -for i in snuke: -    if i == 0: -        cnt += 1 -print(cnt) +    for i in A: +        snukes[i - 1] = 0 +print((sum(snukes)))