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

a = [[0]*N]*K

a = [[0 for n in range(N)] for k in range(K)]



for k in range(K):

    d=int(eval(input()))

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

    for h in have_k:

        a[k][h-1]=1



an=[0]*N

for k in range(K):

  for n in range(N):

    an[n] = an[n]+a[k][n]



result=0

for i in an:

  if i == 0:

    result+=1



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

a = [[0 for n in range(N)] for k in range(K)]



for k in range(K):

    d=int(eval(input()))

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

    for h in have_k:

        a[k][h-1]=1



an=[0]*N

for k in range(K):

  for n in range(N):

    an[n] = an[n]+a[k][n]



result=0

for i in an:

  if i == 0:

    result+=1



print(result)
N, K = list(map(int, input().split()))
a = [[0] * N] * K
a = [[0 for n in range(N)] for k in range(K)]
for k in range(K):
    d = int(eval(input()))
    have_k = list(map(int, input().split()))
    for h in have_k:
        a[k][h - 1] = 1
an = [0] * N
for k in range(K):
    for n in range(N):
        an[n] = an[n] + a[k][n]
result = 0
for i in an:
    if i == 0:
        result += 1
print(result)

N, K = list(map(int, input().split()))
a = [[0 for n in range(N)] for k in range(K)]
for k in range(K):
    d = int(eval(input()))
    have_k = list(map(int, input().split()))
    for h in have_k:
        a[k][h - 1] = 1
an = [0] * N
for k in range(K):
    for n in range(N):
        an[n] = an[n] + a[k][n]
result = 0
for i in an:
    if i == 0:
        result += 1
print(result)

-a = [[0] * N] * K