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

hoge=[0 for j in range(N)]

for j in range(K):

    eval(input())

    for i in input().split():

        hoge[int(i)-1]+=1

print((sum([j==0 for j in hoge])))



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

hoge={}

for j in range(K):

    eval(input())

    [hoge.update({int(j)-1:1}) for j in input().split()]

print((sum([not j in hoge for j in range(N)])))

N, K = list(map(int, input().split()))
hoge = [0 for j in range(N)]
for j in range(K):
    eval(input())
    for i in input().split():
        hoge[int(i) - 1] += 1
print((sum([j == 0 for j in hoge])))

N, K = list(map(int, input().split()))
hoge = {}
for j in range(K):
    eval(input())
    [hoge.update({int(j) - 1: 1}) for j in input().split()]
print((sum([not j in hoge for j in range(N)])))

-hoge = [0 for j in range(N)] +hoge = {} -    for i in input().split(): -        hoge[int(i) - 1] += 1 -print((sum([j == 0 for j in hoge]))) +    [hoge.update({int(j) - 1: 1}) for j in input().split()] +print((sum([not j in hoge for j in range(N)])))