peterverebics/CodeNet_Python_118 huggingface dataset:
n, k = map(int, input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input().split())))

hito = [i+1 for i in range(n)]
for i in a:
    for j in i:
        if j in hito:
            hito.remove(j)

print(len(hito))
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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

s = set()
for i in range(K):
    d = int(input())
    s |= set(map(int, input().split()))

print(N - len(s))
import numpy as np

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

n_count = np.zeros(n, dtype = np.int)
# print(n_count)

for i in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  # print(a)
  for j in range(d):
    n_count[a[j]-1] += 1

# print(n_count)
print(np.count_nonzero(n_count == 0))
n,k = map(int,input().split(" "))
d = []
a = []
get_flag = [0 for i in range(n)]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
#print(d)
#print(a)

for i in range(k):
    for j in range(d[i]):
        for m in range(n):
            if a[i][j] == m+1:
                get_flag[m] = 1
#print(get_flag)
count = 0
for i in range(len(get_flag)):
    if get_flag[i] == 0:
        count += 1
print(count)
N,K=map(int,input().split())
D=[0]*K
A=[0]*K
for i in range(K):
    D[i]=int(input())
    A[i]=list(map(int,input().split()))
d={}
for i in range(1,N+1):
    d[i]=0

for i in range(K):
    for a in A[i]:
        d[a]+=1

ans=0
for i in range(1,N+1):
    if d[i] == 0:
        ans += 1

print(ans)
n, k = map(int, input().split())
A = []
for i in range(k):
    d = int(input())
    A.extend(list(map(int, input().split())))

N = []    
for i in range(1, n+1):
    N.append(i)
# print(A,N)
print(len(set(A)^set(N)))
N, K = map(int, input().split())
m = []
for i in range(K):
  di = int(input())
  A = [d for d in input().split()]
  m = m + A
M = len(set(m))
print(N - M)
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))

n,k = mp()
okasi = [0]*n
for i in range(k):
    d = int(input())
    a = lmp()
    for j in a:
        okasi[j-1] += 1
print(okasi.count(0))
n, k = map(int, input().split())

snacklist = [0]*n

for num in range(0, k):
    d = input()

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

    for bl in boylist:
        snacklist[bl-1] += 1


count = 0

for sl in snacklist:
    if sl == 0:
        count += 1

print(count)
n, k = map(int, input().split())
sunukes = set()
for i in range(1, n + 1):
    sunukes.add(i)

for _ in range(k):
    d = int(input())
    for i in list(map(int, input().split())):
        sunukes.discard(i)

print(len(sunukes))
# coding: utf-8
input1 = input().rstrip().split(" ")
sunuke = [0 for i in range(int(input1[0]))]
array = []
for i in range(int(input1[1])):
    okashi = input()
    okashisunuke = input().rstrip().split(" ")
    for i in range(int(okashi)):
        sunuke[int(okashisunuke[i])-1] += 1
print (sunuke.count(0))
n, k = map(int, input().split())


mans = [0]*n
for _ in range(k):
    how = int(input())
    man = list(map(int, input().split()))
    for i in man:
        mans[i-1] += 1

print(mans.count(0))
N, K = map(int, input().split())

l = []
for i in range(K):
    int(input())
    l = l + list(map(int, input().split()))

ans = 0
for n in range(1, N+1):
    if n in l:
        pass
    else:
        ans += 1

print(ans)
N,K=map(int,input().split())
d=[]
A=[]
for i in range(K):
    x=int(input())
    y=list(map(int,input().split()))
    for i in y:
        A.append(i)

ans=0
for i in range(1,N+1):
    if i in A:
        continue
    else:
        ans+=1
print(ans)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N, K = map(int, input().split())

    d = [True]*N
    for K in range(K):
        dl = input()
        A = list(map(int, input().split()))
        for a in A:
            d[a-1] = False
    print(sum(d))




if __name__ == '__main__':
    main()
n, k = map(int, input().split())
ans = [0] * n

for i in range(k):
    d = int(input())
    a = list(int(i) for i in input().split())
    for i in a:
        ans[i - 1] += 1

# print(ans)
print(ans.count(0))
N, K = map(int,input().split())
S = set(range(1,N+1))
for _ in range(K):
    input()
    A = set(map(int,input().split()))
    S -= A

print(len(S))
n, k = map(int, input().split())

li = []

for i in range(k):
    d = int(input())
    a_li = list(map(int, input().split()))
    li += a_li

print(n - len(set(li)))
N,K = map(int,input().split())
kekka = []
for i in range(K):
    d = int(input())
    A = map(int,input().split())
    for i in A:
        kekka.append(i)
print(N-len(set(kekka)))
N, K = map(int, input().split())
d = [0] * K
y = [0] * N
for i in range(K):
    d[i]=int(input())
    A= list(map(int, input().split()))
    for x in A:
        y[x-1]+=1
a=0
for ans in y:
    if ans==0:
          a+=1
print(a)
n, k = map(int, input().split())
s = [0] * n
for _ in range(k):
    d = int(input())
    for i in list(map(int, input().split())):
        i -= 1; s[i] = 1
print(n - sum(s))
n,k=map(int,input().split())
arr=[0 for i in range(n)]
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for b in a:
        arr[b-1]+=1
cnt=0
for i in range(n):
    if arr[i]==0:
        cnt+=1
print(cnt)
# AtCoder Beginner Contest 166: B (2020/05/03)
N, K = map(int, input().split())
A = [0 for i in range(N)]
for j in range(K):
    d = int(input())
    l = input().split()
    for i in range(d):
        A[int(l[i])-1] = A[int(l[i])-1] + 1
ans = 0
for i in range(N):
    if A[i] == 0:
        ans = ans + 1
print(ans)
n,k = map(int,input().split())
a = [0]*n
for i in range(k):
    d = int(input())
    ai = list(map(int,input().split()))
    for j in ai:
        a[j-1] += 1
ans = 0
for i in range(n):
    if a[i] == 0:
        ans += 1
print(ans)
import itertools
N, K = map(int, input().split())
i=0
dlist=[]
mlist=[]
while(i<K) :
  d = int(input())
  val = input().split()
  dlist.append(d)
  mlist.append(val)
  i+=1
res=0
list=list(itertools.chain.from_iterable(mlist))
if(N==1):
  if(list.count("1")==0):
    res+=1
else:
  j=1
  while(j<=N):
    if(list.count(str(j))==0):
      res+=1
    j+=1
print(res)
n, k = map(int, input().split())

l = [False for _ in range(n)]
for _ in range(k):
    input()
    a = list(map(int, input().split()))
    for ai in a:
        l[ai-1] = True

print(len(list(filter(lambda x: not x, l))))
N,K=map(int,input().split())
l=[False for x in range(N)]
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in A:
        l[j-1]=True
print(l.count(False))
N, K = map(int, input().split())
sunuke = [True]*N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        sunuke[a-1] = False

ans = 0
for i in range(N):
    if sunuke[i]:
        ans += 1
print(ans)
def main(n, k):
    no_sweet = [x + 1 for x in range(n)]
    for _ in range(k):
        input()
        for v in map(int, input().split()):
            if v in no_sweet:
                no_sweet.remove(v)
    print(len(no_sweet))


if __name__ == "__main__":
    n, k = map(int, input().split())
    main(n, k)
# すぬけ君の人数N
# お菓子の種類K
N,K = map(int, input().split())

# すぬけ君の人数分要素のリストを作る
Sunuke_List = [0] * N

# お菓子iを持っているすぬけ君を取得してリストに格納
for i in range(K):
    d_i = int(input())
    A_i = list(map(int, input().split()))
    for j in range(d_i):
        Sunuke_List[A_i[j]-1] = Sunuke_List[A_i[j]-1] + 1

# お菓子が0このすぬけ君の人数を出力
print(Sunuke_List.count(0))
N, K = map(int, input().split())
nums = [i for i in range(N)]
for i in range(K):
    d = int(input())
    s = list(map(int, input().split()))
    for j in s:
        if j-1 in nums:
            nums.remove(j-1)

print(len(nums))
N, K = (int(x) for x in input().split())
d = []
for i in range(1,N+1):
  d.append(i)
#print(d)
#dset = set(d)
for i in range(K):
    di = int(input())
    A = [int(x) for x in input().split()]
      #Aset = set(A)
#    print(A)
    for a in A:
      if a in d:
      	d.remove(a)
print(len(d))
N, K = map(int, input().split())
vec = [0] * N
for _ in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for i in range(d):
    vec[A[i]-1] += 1
print(vec.count(0))
import sys
input=sys.stdin.readline

n,k=map(int,input().split())
snuke=[0]*n
for _ in range(k):
    d=int(input().rstrip())
    a=[int(i) for i in input().split()]
    for i in a:
        snuke[i-1]+=1
ans=0
for i in snuke:
    if i==0:
        ans+=1
print(ans)
import numpy as np
n,k=map(int, input().split())
l = []
for i in range (k):
    d = int(input())
    l.extend(list( map(int,input().split()) ))

print(n-np.unique(l).size)
n,k = map(int,input().split())


t = []
for i in range(n+1):
    t += [i]
t = set(t)
s = set()
for j in range(k):
    di = int(input())
    s.update(map(int,input().split()))
t = t-s-{0}
print(len(t))
n,k=map(int,input().split())
list_a=[]
for d in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  list_a.extend(a)
ans=0
for i in range(1,n+1): 
 if list_a.count(i)==0:
      ans+=1
print(ans)
n, k, = map(int, input().split())
d = []
a = []
chk = [0] * n
for i in range(k):
    _d = (int)(input())
    d.append(_d)
    _a = list(map(int, input().split()))
    a.append(_a)
    for j in _a:
        if chk[j-1] == 0:
            chk[j-1] = 1

#print("d = {}".format(d))
#print("a = {}".format(a))
#print("chk = {}".format(chk))

ret = 0
for i in chk:
    if i == 0:
        ret += 1

print("{}".format(ret))
def main():
    from builtins import int, map, list, print
    import sys
    sys.setrecursionlimit(10 ** 6)

    input = sys.stdin.readline
    input_list = (lambda: input().rstrip().split())
    input_number = (lambda: int(input()))
    input_number_list = (lambda: list(map(int, input_list())))

    N, K = input_number_list()
    ls = [0] * N

    for i in range(K):
        d = input_number()
        L = input_number_list()
        for l in L:
            ls[l - 1] = 1
    print(ls.count(0))


if __name__ == '__main__':
    main()
n,k=map(int,input().split())
a=[]
for i in range(k):
  d=int(input())
  l=list(map(int,input().split()))
  a.extend(l)
a=list(set(a))
print(n-len(a))
n, k = map(int,input().split())

l = [list(map(int,input().split())) for i in range(k*2)]
a=[]
for i in range(1,k+1):
    a.append(l[2*i-1])
b = []
for j in a :
    for item in j :
        b.append(item)

ans = 0
for k in range(1,n+1):
    if b.count(k) == 0 :
        ans += 1

print(ans)
#B
import numpy as np
N, K = map(int,input().split())
A = np.array([0]*N)
for i in range(K):
    d = input()
    have = list(map(int,input().split()))
    for a in have:
        A[a-1] += 1
print(len(A[A==0]))
n,k = map(int,input().split())

from collections import defaultdict
dic = defaultdict(int)


for _ in range(k):
    d = int(input())
    al = list(map(int,input().split()))
    for a in al:
        dic[a] += 1
ans = 0
for i in range(1,n+1):
    if dic[i] == 0:
        ans += 1
print(ans)
n, k = map(int, input().split())
having = set()
for i in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(len(a)):
    having.add(a[j])
print(n-len(having))
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    SW = [0]*N
    for i in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for j in range(d):
            SW[A[j]-1] += 1
    CNT = 0
    
    for i in SW:
        if i == 0:
            CNT += 1
    print(CNT)

if __name__ == '__main__':
    main()
N, K=map(int, input().split())
set_okashi=set()
for i in range(K):
    d=int(input())
    list_d=[i for i in input().split()]
    for j in list_d:
        set_okashi.add(j)
print(N-len(set_okashi))
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import itertools
    n,k=map(int, input().split())
    l=[list(map(int,input().split())) for i in range(2*k)]
    newl=l[1::2]
    newl=itertools.chain(*newl)
    print(n-len(set(newl)))
resolve()
N,K = list(map(int,input().split()))
d=[]
A = []
sunuke = set()
for i in range(K):
    d_i = int(input())
    A_i = list(map(int,input().split()))
    for j in A_i:
        sunuke.add(j)


print(N-len(sunuke))
N, K = map(int, input().split())
s1 = []
for i in range(1, N+1):
  s1.append(i)
s2 = set(s1)
  
d = []
A = []
for i in range(K):
  d.append(int(input()))
  A.append(list(map(int, input().split())))

for i in range(len(A)):
  for j in range(len(A[i])):
    if A[i][j] in s2:
      s2.remove(A[i][j])

print(len(s2))
# coding: UTF-8
import sys
import numpy as np



n,k = map(int, input().split())
ansList = [False for _ in range(n+1)]

for _ in range(k):
	input()
	tmpList = list(map(int, input().split()))
	for person in tmpList:
		ansList[person] = True

print(ansList.count(False) - 1)
N, K = map(int, input().split())
S = set()
for _ in range(K):
    d = int(input())
    S |= set(input().split())
print(N-len(S))
def main():
    N, K = map(int, input().split())
    children_with_sweets = set()
    for i in range(K):
        d = int(input())
        a = set(map(int, input().split()))
        children_with_sweets = children_with_sweets | a        

    print(N - len(children_with_sweets))

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

hum_can = [[] for _ in range(n)]

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        hum_can[a[j] - 1] += [i]

print(hum_can.count([]))
n,k = (int(x) for x in input().split())
sunuke = [True] * n
for i in range(k):
    c = int(input())
    ar = [int(x) for x in input().split()]
    for v in ar:
        sunuke[v - 1] = False

ans = 0
for v in sunuke:
    if v == True:
        ans +=1

print(ans)
N, K = map(int, input().split())
sunu = [0]*N
#print(N,K)
for i in range(K):
  D = int(input())
  A = list(map(int, input().split()))
#  print(D)
#  print(A)
  for j in range(D):
    sunu[A[j]-1] = 1
#
#print(sunu)
z = 0
for i in sunu:
  if i == 0:
    z += 1
#
print(z)
n, m = map(int, input().split())
ql = [tuple(map(int, input().split())) for i in range(2*m)]
a = ql[1::2]
b = []
for x in a:
    b += x
ans = n - len(set(b))
print(ans)
import math

N, K = (int(x) for x in input().split())
itazura = [1] * N
total = 0
for i in range(K * 2):
    for x in input().split():
        if i % 2:
            itazura[int(x) - 1] = 0
print(sum(itazura))
n, k = map(int, input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    A = list(map(int, input().split()))
    a += A
print(n-len(set(a)))
#!/usr/bin/env python3

n, k = map(int, input().split())
having_okasi = set()

for _ in range(k):
    d = int(input())
    if d == 1:
        having_okasi.add(input())
    else:
        having_okasi |= (set(input().split()))

print(n - len(having_okasi))
N,K=map(int,input().split())

sunuke_list=[i+1 for i in range(N)]

for i in range(K):
    d=int(input())
    a=list(map(int,input().split()))
    b=set(sunuke_list)-set(a)
    sunuke_list=list(b)
    
print(len(sunuke_list))
import collections
N , K= map(int, input().split())
c = 0
A =[]
for ia in range(K):
    d = int(input())
    A.extend(list(map(int, input().split())))

sa = collections.Counter(A)
sss = len(sa)
print(N-sss)
N, K = map(int, input().split())
A = list(range(1,N+1))
S = set()
for _ in range(K):
    d = int(input())
    I = list(map(int, input().split()))
    for i in range(d):
        S.add(I[i])

print(len(A)-len(S))
import sys
from math import factorial
from collections import Counter
from fractions import Fraction
import heapq, bisect, fractions
import math
import itertools
sys.setrecursionlimit(10 ** 5 + 10)
INF = 10**15 +5
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
MOD = 10**9 + 7

n, k = MAP()
have = set([])
for i in range(k):
    d = INT()
    a = LIST()
    have = set(list(have) + a)
print(n - len(have))
#B
n, k = map(int, input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input().split())))
# print(d, a)
people = [0] * n
for i in range(k):
    for j in range(len(a[i])):
        # print(i, j)
        people[a[i][j] - 1] += 1
# print(people)
ans = 0
for i in people:
    if i <= 0:
        ans += 1
print(ans)
n, k = map(int, input().split())

li = []
for i in range(k*2):
    d_or_k = list(map(int, input().split()))
    if i % 2 != 0:
        li.extend(d_or_k)

li = list(set(li))
print(n - len(li))
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**7)

# first line
N, K = list(map(int, input().rstrip().split()))

ans = []
for k in range(K):
    d = input().rstrip()
    for i in input().rstrip().split():
        ans.append(i)

print(N - len(set(ans)))
n, k = map(int, input().split())

have = [False] * n
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for j in a:
        have[j-1] = True

count = 0
for i in range(n):
    if not have[i]:
        count += 1
print(count)
n,k = map(int,input().split())
dp = [0]*n
for i in range(k):
    d = int(input())
    A = list(map(int,input().split()))
    for i in A:
        dp[i-1] +=1

print(dp.count(0))
N, K = (int(x) for x in input().split())
check=[False]*N
ans=N
for i in range(K):
  d=int(input())
  A=list(map(int, input().split()))
  for j in range(d):
    if check[A[j]-1]==False:
      ans-=1
      check[A[j]-1]=True
print(ans)
N, K = map(int, input().split())

sunuke = [0] * N
for i in range(K):
    _ = input()
    kasi_moti = map(int, input().split())
    for j in kasi_moti:
        sunuke[j - 1] = 1

count = 0
for k in sunuke:
    if k == 0:
        count += 1
print(count)
N,K  = map(int,input().split())
S = set()
for i in range(K) :
    D=int(input())
    L=list(map(int, input().split()))
    for A in L :
         S.add(A)
print (N-len(S))
N,K = map(int,input().split())
P=[0]*N

for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in range(d):
        P[A[j]-1]=1

print(N-sum(P))
n, k = [int(x) for x in input().split()]
using = { x:0 for x in range(1, n + 1)}
for _ in range(k):
    nbs = int(input())
    users = [int(x) for x in input().split()]
    for use in users:
        using[use] += 1
    victims = 0
#print(using)
for i, v in using.items():
    #print(v)
    if v == 0:
        victims += 1
print(victims)
n, k = list(map(int, input().split(" ")))
L = [0]*n

for v in range(k):
    d_ = int(input())
    d__ = input()
    d_l = list(map(int, d__.split(" ")))
    for v in range(d_):
        m = d_l[v]
        L[m-1] += 1
print(L.count(0))
n,k=map(int,input().split())
d=[]
a=[]

c=[]

for i in range(k):

    d.append(input())

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

    for o in range(len(a)):

        c.append(a[o])

b=list(set(c))

print(n-len(b))
# input
N, K = map(int, input().split())
D = []
A = []
for _ in range(K):
    D.append(int(input()))
    A.extend(list((map(int, input().split()))))

# process
ans = 0
for i in range(1, N+1):
    if not i in A:
        ans += 1

# output
print(ans)
n, k = map(int, input().split())
s = [0]*(n+1)

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        s[a[j]] += 1

cnt = 0        
for k in range(1,n+1):
    if s[k] == 0:
        cnt += 1
        
print(cnt)
n, k = map(int, input().split())
A_list  =[]
import numpy as np
nuske = np.zeros(n)

for _ in range(k): 
    d = input()
    a = list(map(int, input().split()))
    for i in a:
        nuske[ i-1] +=1

p =0

for i in range(len(nuske)):
    if nuske[i] ==0:
        p+=1

print(p)
N,K=map(int,input().split())
l = []
for k in range(K):
    a = int(input())
    lis=list(map(int,input().split()))
    l.extend(lis)
c=0
for j in range(N):
    if not j+1 in l:
        c+=1
print(c)
def main():
    n, k = map(int, input().split())
    sunuke = set()
    for _ in range(k):
        input()
        sunuke |= set(map(int, input().split()))
    print(len(set(range(1, n+1))-sunuke))

if __name__ == "__main__":
    main()
n,k = map(int,input().split(' '))
l = set(range(1,n+1))
la = set()
for i in range(k):
    d = int(input())
    a = set(map(int,input().split()))
    la = la | a
print(len(l-la))
def main():

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

    Z = set()

    for _ in range(K):
        _ = int(input())
        Ad = map(int, input().split())

        Z |= set(Ad)

    print(N - len(Z))


main()
from collections import defaultdict

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

res = []
for i in range(k):
    kashi = int(input())
    res += [int(i) for i in input().split()]

print(n - len(set(res)))
n, k = map(int, input().split())
t = [0 for _ in range(n)]
for i in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  for j in a:
    t[j-1] += 1
print(t.count(0))
N, K = map(int, input().split())
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

lis = []

for i in A:
    for j in i:
        if j in lis:
            continue
        else:
            lis.append(j)
print(N-len(lis))
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N,K = LI()
dA = [[LI() for _ in range(2)] for _ in range(K)]
num = set()
for x in dA:
    d,A = x
    for y in A:
        num.add(y)
print(N-len(num))
N, K = map(int, input().split())
S=[]
for i in range(2*K):
    a = input().split()
    if i%2 ==1:
        S.extend(a)

print(N-len(set(S)))
def resolve():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().split()))

    has = set()

    for i in range(k):
        d = input().rstrip()
        x = list(map(int, input().split()))
        for a in x:
            has.add(a)

    count = 0
    for i in range(n):
        if i +1 not in has:
            count += 1
    print(count)

# x = list(map(int, input().split()))

if __name__ == "__main__":
    resolve()
import itertools

N,K=map(int,input().split())
dA=list(input().split() for _ in range(2*K))
ans=[0]*K

for i in range(2*K):
    if i%2!=0:
        ans[i//2]=dA[i]
print(N-len(set(list(itertools.chain.from_iterable(ans)))))
n, k = map(int, input().split())

okashi = set()
for _ in range(k):
  d = int(input())
  lst = [int(i) for i in input().split()]
  for i in range(d):
    if lst[i] not in okashi:
      okashi.add(lst[i])
count = 0
for i in range(n):
  if i + 1 not in okashi:
    count += 1
print(count)
n,k = map(int,input().split())
okashi = [0 for i in range(n+1)]

for i in range(k):
    d = int(input())
    if(d==1):
        oka = int(input())
        okashi[oka] += 1
    else:
        oka = list(map(int,input().split()))
        
        for j in oka:
            okashi[j] += 1
c = 0
for i in okashi:
    if(i==0):
        c+=1
print(c-1)
n,k = map(int,input().split(" "))
sunuke = [0]*n
for i in range(k):
  d = int(input())
  a = list(map(int,input().split(" ")))
  for a_i in a:
    sunuke[a_i-1] += 1
sum_sunuke = 0
for sunuke_i in sunuke:
  if sunuke_i == 0:
    sum_sunuke += 1
print(sum_sunuke)
n,k=map(int,input().split())
x=[1]*n
for i in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for j in range(d):
    x[a[j]-1]=0
    
print(sum(x))
n,k=map(int,input().split())
sunuke=[0]*n
for i in range(k):
 d=int(input())
 a=list(map(int,input().split()))
 
 for j in range(d):
  sunuke[a[j]-1]+=1
  
ninnzuu=0

for i in range(n):
 if sunuke[i]==0:
  ninnzuu+=1
print(ninnzuu)
n, k = map(int, input().split())

cnt = [0]*n

for i in range(k):
    d = int(input())
    for j in tuple(map(int, input().split())):
        cnt[j-1] += 1

print(cnt.count(0))
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
#dt = {k:v for k,v in sorted(x.items(), key=lambda i: i[1])}
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

n,k = mp()
dt = {}
for i in range(1,n+1):
    dt[i] = 0
for i in range(k):
    d = inp()
    x = ip()
    for i in x:
        dt[i] = 1
print(list(dt.values()).count(0))