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

d = []

A = []



for _ in range(K):

    d.append(int(eval(input())))

    A.append(list(map(int, input().split())))



cnt = {}

for i in range(N):

    cnt.setdefault(str(i + 1), 0)



for Ai in A:

    for Aij in Ai:

        cnt[str(Aij)] += 1



ans = 0

for key, val in list(cnt.items()):

    if val == 0: ans += 1



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

d = []

A = []

for _ in range(K):

    d.append(int(eval(input())))

    A.append(list(map(int, input().split())))



cnt = {}

for i, Ai in enumerate(A):

    for j, Aij in enumerate(Ai):

        key = str(Aij)

        cnt.setdefault(key, 0)

        cnt[key] += 1



ans = 0

for i in range(1, N + 1):

    key = str(i)

    cnt.setdefault(key, 0)

    ans += int(cnt[key] == 0)



print(ans)
N, K = list(map(int, input().split()))
d = []
A = []
for _ in range(K):
    d.append(int(eval(input())))
    A.append(list(map(int, input().split())))
cnt = {}
for i in range(N):
    cnt.setdefault(str(i + 1), 0)
for Ai in A:
    for Aij in Ai:
        cnt[str(Aij)] += 1
ans = 0
for key, val in list(cnt.items()):
    if val == 0:
        ans += 1
print(ans)

N, K = list(map(int, input().split()))
d = []
A = []
for _ in range(K):
    d.append(int(eval(input())))
    A.append(list(map(int, input().split())))
cnt = {}
for i, Ai in enumerate(A):
    for j, Aij in enumerate(Ai):
        key = str(Aij)
        cnt.setdefault(key, 0)
        cnt[key] += 1
ans = 0
for i in range(1, N + 1):
    key = str(i)
    cnt.setdefault(key, 0)
    ans += int(cnt[key] == 0)
print(ans)

-for i in range(N): -    cnt.setdefault(str(i + 1), 0) -for Ai in A: -    for Aij in Ai: -        cnt[str(Aij)] += 1 +for i, Ai in enumerate(A): +    for j, Aij in enumerate(Ai): +        key = str(Aij) +        cnt.setdefault(key, 0) +        cnt[key] += 1 -for key, val in list(cnt.items()): -    if val == 0: -        ans += 1 +for i in range(1, N + 1): +    key = str(i) +    cnt.setdefault(key, 0) +    ans += int(cnt[key] == 0)