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

LI=list(range(1,n+1))

kari=n+1

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

  d=int(eval(input()))

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

  for x in range(1,n+1):

    if li.count(x)!=0:

      if LI.count(x)!=0:

        LI.remove(x)

print((len(LI)))

      

      

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

cnt=[0]*(n)

for i in range(k):

  d=int(eval(input()))

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

  for j in kou:

    cnt[j-1]=1

print((cnt.count(0)))
n, k = list(map(int, input().split()))
LI = list(range(1, n + 1))
kari = n + 1
for i in range(1, k + 1):
    d = int(eval(input()))
    li = list(map(int, input().split()))
    for x in range(1, n + 1):
        if li.count(x) != 0:
            if LI.count(x) != 0:
                LI.remove(x)
print((len(LI)))

n, k = list(map(int, input().split()))
cnt = [0] * (n)
for i in range(k):
    d = int(eval(input()))
    kou = list(map(int, input().split()))
    for j in kou:
        cnt[j - 1] = 1
print((cnt.count(0)))

-LI = list(range(1, n + 1)) -kari = n + 1 -for i in range(1, k + 1): +cnt = [0] * (n) +for i in range(k): -    li = list(map(int, input().split())) -    for x in range(1, n + 1): -        if li.count(x) != 0: -            if LI.count(x) != 0: -                LI.remove(x) -print((len(LI))) +    kou = list(map(int, input().split())) +    for j in kou: +        cnt[j - 1] = 1 +print((cnt.count(0)))