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

 

tmp = set()

 

for i in range(K):

  eval(input())

  tmp.update(list(map(int, input().split())))

 

print((N - len(tmp)))
N, K = list(map(int, input().split()))

 

tmp = [0] * N

 

for i in range(K):

  eval(input())

  for j in map(int, input().split()):

    tmp[j-1] |= 1 

print((N - sum(tmp)))

N, K = list(map(int, input().split()))
tmp = set()
for i in range(K):
    eval(input())
    tmp.update(list(map(int, input().split())))
print((N - len(tmp)))

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

-tmp = set() +tmp = [0] * N -    tmp.update(list(map(int, input().split()))) -print((N - len(tmp))) +    for j in map(int, input().split()): +        tmp[j - 1] |= 1 +print((N - sum(tmp)))