# B



inp = input().split(' ')

N, K = int(inp[0]), int(inp[1])



sunuke = [1] * N



for i in range(K):

    di = int(eval(input()))

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

    for t in tmp:

        sunuke[t-1] = 0

print((sum(sunuke)))
# B



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



sunuke = [1] * N



for i in range(K):

    di = int(eval(input()))

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

    for t in tmp:

        sunuke[t-1] = 0

print((sum(sunuke)))
# B
inp = input().split(" ")
N, K = int(inp[0]), int(inp[1])
sunuke = [1] * N
for i in range(K):
    di = int(eval(input()))
    tmp = list(map(int, input().split()))
    for t in tmp:
        sunuke[t - 1] = 0
print((sum(sunuke)))

# B
N, K = list(map(int, input().split()))
sunuke = [1] * N
for i in range(K):
    di = int(eval(input()))
    tmp = list(map(int, input().split()))
    for t in tmp:
        sunuke[t - 1] = 0
print((sum(sunuke)))

-inp = input().split(" ") -N, K = int(inp[0]), int(inp[1]) +N, K = list(map(int, input().split()))