(n,k),*p = [[*list(map(int, i.split()))] for i in open(0)]

a = sum([p[2*i+1] for i in range(k)],[])

print((n - len(set(a))))
n,k = list(map(int, input().split()))

a = set()

for i in [0]*k:

    _ = eval(input())

    a = a | set([*list(map(int, input().split()))])

print((n - len(a)))
(n, k), *p = [[*list(map(int, i.split()))] for i in open(0)]
a = sum([p[2 * i + 1] for i in range(k)], [])
print((n - len(set(a))))

n, k = list(map(int, input().split()))
a = set()
for i in [0] * k:
    _ = eval(input())
    a = a | set([*list(map(int, input().split()))])
print((n - len(a)))

-(n, k), *p = [[*list(map(int, i.split()))] for i in open(0)] -a = sum([p[2 * i + 1] for i in range(k)], []) -print((n - len(set(a)))) +n, k = list(map(int, input().split())) +a = set() +for i in [0] * k: +    _ = eval(input()) +    a = a | set([*list(map(int, input().split()))]) +print((n - len(a)))