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

lists=[]

for _ in range(k):

  d=int(eval(input()))

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

  lists.append(lis)

ans=[0]*n

for list in lists:

  for i in range(len(list)):

    ans[list[i]-1]+=1

count=0

for h in ans:

  if h==0:

    count+=1

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

lists=[]

for _ in range(k):

  d=int(eval(input()))

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

  lists.append(a)

num=[0]*n

for list in lists:

  for __ in range(len(list)):

    num[list[__]-1]+=1

count=0

for nn in num:

  if nn==0:

    count+=1

print(count)
n, k = list(map(int, input().split()))
lists = []
for _ in range(k):
    d = int(eval(input()))
    lis = list(map(int, input().split()))
    lists.append(lis)
ans = [0] * n
for list in lists:
    for i in range(len(list)):
        ans[list[i] - 1] += 1
count = 0
for h in ans:
    if h == 0:
        count += 1
print(count)

n, k = list(map(int, input().split()))
lists = []
for _ in range(k):
    d = int(eval(input()))
    a = list(map(int, input().split()))
    lists.append(a)
num = [0] * n
for list in lists:
    for __ in range(len(list)):
        num[list[__] - 1] += 1
count = 0
for nn in num:
    if nn == 0:
        count += 1
print(count)

-    lis = list(map(int, input().split())) -    lists.append(lis) -ans = [0] * n +    a = list(map(int, input().split())) +    lists.append(a) +num = [0] * n -    for i in range(len(list)): -        ans[list[i] - 1] += 1 +    for __ in range(len(list)): +        num[list[__] - 1] += 1 -for h in ans: -    if h == 0: +for nn in num: +    if nn == 0: