n,k=list(map(int,input().split()))

ans=[0]*n

for i in range(k):

    d=int(eval(input()))

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

    for j in a:

        ans[j-1]=1

print((n-sum(ans)))



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

A = set()

for _ in range(K):

  d = eval(input())

  A = A.union(set(map(int, input().split())))

print((N - len(A)))
n, k = list(map(int, input().split()))
ans = [0] * n
for i in range(k):
    d = int(eval(input()))
    a = list(map(int, input().split()))
    for j in a:
        ans[j - 1] = 1
print((n - sum(ans)))

N, K = list(map(int, input().split()))
A = set()
for _ in range(K):
    d = eval(input())
    A = A.union(set(map(int, input().split())))
print((N - len(A)))

-n, k = list(map(int, input().split())) -ans = [0] * n -for i in range(k): -    d = int(eval(input())) -    a = list(map(int, input().split())) -    for j in a: -        ans[j - 1] = 1 -print((n - sum(ans))) +N, K = list(map(int, input().split())) +A = set() +for _ in range(K): +    d = eval(input()) +    A = A.union(set(map(int, input().split()))) +print((N - len(A)))