Problem:
 Score : 200 points    Problem Statement N  Snukes called Snuke 1 , Snuke 2 , ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1 , Snack 2 , ..., Snack K . The following d_i Snukes have Snack i : Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}} .  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq K \leq 100  1 \leq d_i \leq N  1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N         Input Input is given from Standard Input in the following format:  N  K  d_1  A_{1, 1} \cdots A_{1, d_1}  \vdots  d_K  A_{K, 1} \cdots A_{K, d_K}       Output Print the answer.        Sample Input 1 3 2
2
1 3
1
3      Sample Output 1 1   Snuke 1 has Snack 1 .  Snuke 2 has no snacks.  Snuke 3 has Snack 1 and 2 .   Thus, there will be one victim: Snuke 2 .       Sample Input 2 3 3
1
3
1
3
1
3      Sample Output 2 2

Solution (Python):
n,k = map(int,input().split())

count = 0
p = []

for i in range(n):
    p.append(0)

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

for i in range(n):
    if p[i] == 0:
        count += 1

print(count)

Solution (Python):
n, k = map(int, input().split())
all_sunuke = [1]*n

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

print(sum(all_sunuke))

Solution (Python):
N, K = map(int, input().split(" "))

sum_ita = 0
have = [0 for i in range(N)]

for i in range(K):
    d = int(input())
    nyu = list(map(int, input().split(" ")))
    for row in nyu:
        have[row - 1] += 1

print(have.count(0))

Solution (Python):
n,k=map(int,input().split())
x=[]
for i in range(k):
  d=int(input())
  y=list(map(int,input().split()))
  for j in range(d):
    x.append(y[j])
z=set(x)
print(n-len(z))

Solution (Python):
n, k = map(int, input().split())  

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


bitl = 2**n - 1
for kashi in a:
    for i in kashi:
        bitl &= ~(1 << (i - 1))

print(bin(bitl).count("1"))

Solution (Python):
n,k=map(int,input().split())
ans=[0]*n
for i in range(k):
    d=input()
    a=[int(x) for x in input().split()]
    for j in range(len(a)):
        ans[a[j]-1]+=1
print(ans.count(0))

Solution (Python):

n,k = map(int, input().split())
motterulist = []
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    motterulist.extend(a)
print(n - len(list(set(motterulist))))

Solution (Python):
N,K = map(int,input().split())
lst = []
for i in range(K):
    d = int(input())
    sunuke = list(map(int,input().split()))
    n = 0
    while n < d:
        lst.append(sunuke[n])
        n += 1
moratta = len(set(lst))
print(N - moratta)

Solution (Python):
N, K = map(int, input().split())
j = 0
count = 0
index = []
index2 = []
for i in range(1, K+1):
    d = int(input())
    index.append(input().split())
for i in range(len(index)):
    for j in index[i]:
        index2.append(j)
        index3 = set(index2)
print(N - len(index3))

Solution (Python):
N_setup_data = input().split()
N_sunuke_number = int(N_setup_data[0])
K_snack_number = int(N_setup_data[1]) - 1
K_snack_number = int(N_setup_data[1])
N_sunuke_pocket = [0] * N_sunuke_number


for j in range(K_snack_number):
	N_A_sunuke_pocket = [0] * (N_sunuke_number + 1)
	N_B_sunuke_pocket = [0] * (N_sunuke_number + 1)
	d = input()
	N_A_sunuke_pocket = input().split()

	for i in N_A_sunuke_pocket:
		N_B_sunuke_pocket[int(i) - 1] += 1

	j = 0

	for i in N_B_sunuke_pocket:
		if i != 0:
			N_sunuke_pocket[j] += 1
		j += 1

def calc_area():
	Out_Area = 0
	for i in N_sunuke_pocket:
		if i == 0:
			Out_Area += 1
	return Out_Area

print(calc_area())

Solution (Python):
import sys,bisect,string,math,time,functools,random
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,ls=None,Directed=False,index=1):
    org_inp=[];g=[[] for i in range(V)]
    FromStdin=True if ls==None else False
    for i in range(E):
        if FromStdin:
            inp=LI()
            a,b,c=(inp+[1])[:3]
            org_inp.append(inp)
        else:
            index=0
            a,b,c=(ls[i]+[1])[:3]
        if index==1:a-=1;b-=1
        aa=(a,c);bb=(b,c);g[a].append(bb)
        if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)];rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

class Comb:
    def __init__(self,n,mo=10**9+7):
        self.fac=[0]*(n+1)
        self.inv=[1]*(n+1)
        self.fac[0]=1
        self.fact(n)
        for i in range(1,n+1):
            self.fac[i]=i*self.fac[i-1]%mo
            self.inv[n]*=i
            self.inv[n]%=mo
        self.inv[n]=pow(self.inv[n],mo-2,mo)
        for i in range(1,n):
            self.inv[n-i]=self.inv[n-i+1]*(n-i+1)%mo
        return
    
    def fact(self,n):
        return self.fac[n]
        
    def invf(self,n):
        return self.inv[n]

    def comb(self,x,y):
        if y<0 or y>x:
            return 0
        return self.fac[x]*self.inv[x-y]*self.inv[y]%mo

class Tree:
    def __init__(self,inp_size=None,init=True):
        if init:
            self.stdin(inp_size)
        return

    def stdin(self,inp_size=None):
        if inp_size==None:
            self.size=int(input())
        else:
            self.size=inp_size
        self.edges,_=GI(self.size,self.size-1)
        return
    
    def listin(self,ls):
        self.size=len(ls)+1
        self.edges,_=GI(self.size,self.size-1,ls)
        return

    def __str__(self):
        return  str(self.edges)

    def dfs(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append(x)
        v=[-1]*self.size
        v[x]=root_v
        while q:
            c=q.pop()
            for nb,d in self.edges[c]:
                if v[nb]==-1:
                    q.append(nb)
                    v[nb]=func(v[c],nb,d)
        return v

    def EulerTour(self,x,func=lambda prv,nx,dist:prv+dist,root_v=0):
        q=deque()
        q.append((-1,x))
        v=[None]*self.size
        v[x]=root_v
        et=[]
        while q:
            cb,ce=q.pop()
            et.append(ce)
            for nb,d in self.edges[ce]:
                if v[nb]==None:
                    q.append((nb,ce))
                    q.append((ce,nb))
                    v[nb]=func(v[ce],nb,d)
        vid=[[-1,-1]for i in range(self.size)]
        for i,j in enumerate(et):
            if vid[j][0]==-1:
                vid[j][0]=i
            else:
                vid[j][1]=i
        return v,et,vid
    
    def LCA_init(self,depth,et):
        self.st=SegTree(self.size*2-1,func=min,ide=inf)
        for i,j in enumerate(et):
            self.st.update(i,j)
        self.LCA_init_stat==True
        return
    
    def LCA(self,root,x,y):
        if self.LCA_init_stat==False:
            depth,et,vid=self.EulerTour(root)
            self.LCA_init(depth,et)
        return self.st.query(x,y+1)

show_flg=False
show_flg=True
ans=0

n,k=LI()
m=[1]*n
for i in range(k):
    d=I()
    a=LI_()
    for j in a:
        m[j]=0
        
ans=sum(m)
print(ans)

Solution (Python):
import itertools
n,m=map(int,input().split())
l=[input() for i in range(2*m)]
l=l[1::2]
a=[]
for j in l:
    a.append(j.split())
b=list(itertools.chain.from_iterable(a))
c=[int(j) for j in b]
d=list(set(c))
e=[]
for k in range(1,n+1):
    e.append(k)
print(len(e)-len(d))

Solution (Python):
n,k=map(int,input().split())
count=0
l,p=[],[]
for i in range(k):
	d=int(input())
	a=list(map(int,input().split()))
	for i in range(1,n+1):
		if i in a:
			l.append(i)
for i in range(1,n+1):
	if i not in l:
		p.append(i)
print(len(p))

Solution (Python):
d=[];
A=[];
N,K=input().split();
N=int(N);
K=int(K);
for i in range(K):
  d.append(input())
  A.append(input().split());
count=0;
for i in range(N):
  flag=0;
  for j in range(K):
    if(str(i+1) in A[j]):
      flag=1;
  if (flag == 0):
    count+=1;
print(count);

Solution (Python):
N,K = map(int,input().split())
res = [0] * N
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for j in A:
        res[j-1] +=1
print(res.count(0))

Solution (Python):
N, K = map(int, input().split())

sunuke = list(range(1, N+1))

for i in range(K):
  _ = int(input())
  for okashi in map(int, input().split()):
    
    if okashi in sunuke:
      sunuke.remove(okashi)

print(len(sunuke))

Solution (Python):
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)

Solution (Python):
n, k = map(int, input().split())

temp_array = []

for _ in range(k):
  temp = input()
  [temp_array.append(i) for i in list(map(int, input().split())) if i != ""]

all_member = len(list(set(temp_array)))
print(n - all_member)

Solution (Python):

n,k = (int(x) for x in input().split())



wk=[]
cnt=0

while cnt<k:
    d=input()
    a = (int(x) for x in input().split())
    for i in a:
        wk.append(i)
    cnt+=1

wk=set(wk)
ans = n - len(wk)
print(ans)

Solution (Python):
N, K = map(int, input().split())
j = 0
ls1 = []
ls2 = []

for i in range(1, K+1):
    d = int(input())
    ls1.append(input().split())
for i in range(len(ls1)):
    for j in ls1[i]:
        ls2.append(j)
        x = set(ls2)
print(N - len(x))

Solution (Python):
n,k = [int(j) for j in input().split(" ")]

a = []
for _ in range(k):
    _ = int(input())
    a.append([int(j) for j in input().split(" ")])

a_set = set(sum(a, []))
n_set = {j+1 for j in range(n)}
print(len(n_set - a_set))

Solution (Python):
n, k = map(int, input().split())
a = [0] * n
cnt = 0
b = []

for i in range(k):
    d = int(input())
    b.append(input().split())
    

    for j in range(d):
        b[i][j] = int(b[i][j])
        a[b[i][j] - 1] += 1
for i in range(n):
    if a[i] == 0:
        cnt += 1

print(cnt)

Solution (Python):
N, K = map(int, input().split())

sunuke_set = set(range(1, N + 1))
for k in range(K):
    input()
    removed_sunuke_set = set(map(int, input().split()))
    for sunuke in removed_sunuke_set:
        if sunuke in sunuke_set:
            sunuke_set.remove(sunuke)
print(len(sunuke_set))

Solution (Python):
n,k = map(int,input().split())
ans = [1]*n
for i in range(k):
    x = int(input())
    x = list(map(int,input().split()))
    for j in x:
        ans[j-1] = 0
print(sum(ans))

Solution (Python):
n,k = input().split()
n = int(n)
k = int(k)
l = [0] * n

for i in range(k):
    tmp = int(input())
    tmp2 = list(map(int,input().split()))
    for j in range(tmp):
        l[tmp2[j]-1] = 1

print(l.count(0))

Solution (Python):
import itertools
N,K = map(int, input().split())
a = [input().split() for i in range(2*K)]

b = []

for j in range(K):
    b.append(a[2*j +1])
b = list(itertools.chain.from_iterable(b))
b = set(b)
print(N-len(b))

Solution (Python):
li=[]
count=0
a=set()
n,k=map(int,input().split())
for i in range(k):
  d=int(input())
  b=list(map(int,input().split()))
  for j in range(len(b)):
      a.add(b[j])
a=list(a)
for k in range(1,n+1):
    if k not in a:
        count=count+1
print(count)

Solution (Python):
n,k=map(int, input().split())

import itertools
d_list=[]
a_list=[]
trick_list=[]
trick=0
sunu_list=[i for i in range(1,n+1)]

for i in range(0,k):
  d=int(input())
  d_list.append(d)
  a = list(map(int, input().split()))
  a_list.append(a)

for sunu in a_list:
  trick_list=list(set(sunu_list)-set(sunu))
  sunu_list=trick_list


print(len(sunu_list))

Solution (Python):
n, k = map(int, input().split())
d = []
a = []

for i in range(k):
    d.append(int(input()))
    a.append(list(map(int, input().split())))

buf = [0 for i in range(n)]

for i in range(k):
    for j in range(d[i]):
        buf[a[i][j] - 1] = 1

k = n - sum(buf)
print(k)

Solution (Python):
N , K =map(int,input().split())
s = {n for n in range(1 , N+1)}
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    ss = set(A)
    s = s - ss
print(len(s))

Solution (Python):
N, K = map(int, input().split())
j = 0
ls1 = []
ls2 = []

for i in range(1, K+1):
    d = int(input())
    ls1.append(input().split())
for i in range(len(ls1)):
    for j in ls1[i]:
        ls2.append(j)
        x = set(ls2)
print(N - len(x))

Solution (Python):
N ,K = input().split()
N = int(N)
K = int(K)

d = {}
for i  in range(N):
    if i+1 not in d:
        d.setdefault(str(i+1) , 0)

while(K):
    tmp = input()
    data = input().split()

    for i in range(int(tmp)):
        if data[i] in d:
            d[data[i]]+=1
    
    K-=1

count = 0 
for k,v in d.items():
    if v == 0 :
        count+=1
print(count)

Solution (Python):


nk = list(map(int, input().split()))
a = [input().split() for l in range(nk[1]*2)]

import itertools





a_2 = a[1::2]

count = 0

aaa = list(itertools.chain.from_iterable(a_2))

for m in range(1, nk[0]+1):

    if not(str(m) in aaa):
        count += 1

print(count)

Solution (Python):
def start():
    n, k = input().split()
    n = int(n)
    k = int(k)
    bs = [0 for i in range(n)]
    for j in range(k):
        di = input()
        ds = input().split()
        for d in ds:
            d = int(d)
            bs[d - 1] += 1
    n = bs.count(0)
    print(n)


if __name__ == '__main__':
    start()

Solution (Python):
N,K=map(int,input().split())
res={0}
for i in range(K):
    d=int(input())
    if d==1:
        res|={int(input())}
    else:
        res|=set(map(int,input().split()))
res=[x for x in res if x!=0]
print(N-len(res))

Solution (Python):
n,k = map(int,input().split())

ans = [1]*n

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

print(sum(ans))

Solution (Python):
import itertools
n, k = map(int, input().split())
ans = []
count = 0
for i in range(k):
    d = int(input())
    A = input().split()
    ans.append(A)


print(n - len(set(list(itertools.chain.from_iterable(ans))))
      )

Solution (Python):
n,k = list(map(int,input().split()))
l = [0]*(n+1)
for _ in range(k) :
    d = int(input())
    a = list(map(int,input().split()))
    for i in a :
        l[i] = l[i] + 1
print(len(list(filter(lambda x:x == 0,l)))-1)

Solution (Python):

N,K = map(int, input().split())
N_LIST = []


for i in range(N):
    N_LIST.append(0)




for i in range(K):
    di = int(input())
    who_has_di_list = input().split()

    
    for i in range(len(who_has_di_list)):
        num = int(who_has_di_list[i])
        if N_LIST[num-1] == 0:
            N_LIST[num-1] = 1


ans = 0

for i in range(len(N_LIST)):
    ans += N_LIST[i]

Ans = len(N_LIST) - ans

print(Ans)

Solution (Python):
N,K=map(int,input().split())

box=[]
for x in range(K):
    a=int(input())
    n=list(map(int,input().split()))
    box+=n

print(N-len(set(box)))

Solution (Python):
mylist= []
N, K = map(int,input().split())
for i in range(K):
    d = int(input())
    array = list(map(int, input().strip().split()))
    mylist.extend(array)

a = 0
for l in range(1, N+1):
    if l not in mylist:
        a = a + 1

print(a)

Solution (Python):
import collections
import itertools

n, k = map(int, input().split())
a = [list(map(int, input().split())) for i in range(2*k)]

sunuke_list = a[1::2]
sunuke_list2 = list(itertools.chain.from_iterable(sunuke_list))

ans = n - len(set(sunuke_list2))

print(ans)

Solution (Python):
N,K = map(int, input().split())

count=0

c = [0] * (N+1)

for i in range(K):
    d = int(input())
    a = [int(d) for d in input().split()]
    for j in a:
        c[j] += 1

for i in c:
    if (i == 0):
        count+=1

print(count-1)

Solution (Python):
import itertools
n,k=map(int,input().split())
li=[input().split() for i in range(2*k)]
new=li[1::2]
count=0
a=list(itertools.chain.from_iterable(new))
print(n-len(set(a)))

Solution (Python):
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)

Solution (Python):
(n, k) = tuple(map(int, input().split(" ")))

sa = [0 for i in range(n)]
for i in range(k):
    input()
    for a in map(int, input().split(" ")):
        sa[a - 1] += 1
c = 0
for i in range(n):
    if sa[i] == 0:
        c += 1
print(c)

Solution (Python):
N, K = [int(i) for i in input().split(" ")]


n = [0]*N

for k in range(K):
    d = int(input())
    a = [int(i_s) for i_s in input().split(" ")]
    for i in a:
        n[i-1] = 1

print(n.count(0))

Solution (Python):
n, k = map(int, input().split())
i = 0
c = []
while i < k:
    d = int(input())
    b = list(map(int, input().split()))
    for j in b:
        if j not in c:
            c.append(j)
    i += 1
print(n - len(c))

Solution (Python):
N, K = input().split(" ")

okasi_nasi = set()
for i in range(int(K)*2):
    buf = input()
    if i % 2 == 1:
        if buf[0] != "":
            okasi_nasi = okasi_nasi | set(buf.split(" "))

print(int(N) - len(okasi_nasi))

Solution (Python):
N,K = map(int, input().split())
A=[]
for i in range(K):
    d = int(input())
    a=list(map(int, input().split()))
    for i in range(d):
        A.append(a[i])

ans = len(list(set(A)))
print(N-ans)

Solution (Python):
import itertools

n, k = map(int, input().split())
a = []
sunuke = list(range(1, n + 1))


for i in range(k):
    d = int(input())
    a.append(map(int, input().split()))

a2 = list(itertools.chain.from_iterable(a))
result = set(sunuke) - set(a2)
print(len(result))

Solution (Python):
n, k = map(int, input().split())
a = []
for i in range(k):
    d = int(input())
    b = [int(_) for _ in input().split()]
    a += b
a_set = set(a)
print(n-len(a_set))

Solution (Python):
import math
from functools import reduce



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








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

lista = reduce(lambda a, b: a + b, lista)
lista = list(set(lista))
print(N - len(lista))

Solution (Python):
N, K = map(int,input().split())
LIST = []
for i in range(K): 
    d_i = int(input())
    
    nest_list = list(map(int,input().split())) 
    LIST.append(nest_list)

all_set = set(list(range(1, N+1)))
difference_set = all_set

for nest_list in LIST:
    nest_set = set(nest_list)
    difference_set = difference_set - nest_set 

print(len(difference_set))

Solution (Python):
n,k=map(int,input().split())
m=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for i in a:
    if i not in m:
      m.append(i)
mx=max(m)
c=0
for i in range(1,n+1):
  if(i not in m):
    c+=1
print(c)

Solution (Python):
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))

Solution (Python):
N,K=map(int,input().split())
D=[]
A=[]
S=set()
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])):
    S.add(A[i][j])
ans=N-len(S)
print(ans)

Solution (Python):
nk=input().split()
total=set(range(1,int(nk[0])+1))
mina=set()
for r in range(int(nk[1])):
    D=int(input())
    A=list(map(int,input().split()))
    mina=mina|set(A)
anser=total-mina
print(len(anser))

Solution (Python):
N, K = map(int, input().split())
n=set(range(1,N+1))
d=[0]*K
A=[0]*K
Aset=set()

for i in range(K):
    d[i]=int(input())
    A[i]=list(map(int, input().split()))
    Aset.update(set(A[i]))
nA_dif=n-Aset
print(len(nA_dif))

Solution (Python):
n, k = map(int, input().split())

havesnack = [0 for x in range(n + 1)]

for i in range(k):
    d = int(input())
    dlist = list(map(int, input().split()))
    for dl in dlist:
        havesnack[dl] = 1

count = 0

for i in range(1, n + 1):
    if havesnack[i] == 0:
        count += 1

print(count)

Solution (Python):
N,K = map(int, input().split())

flag = [False] * N
for _ in range(K):
    d = int(input())
    A = [int(i) - 1 for i in input().split()]
    for a in A:
        flag[a] = True

print(flag.count(False))

Solution (Python):
import sys
import collections
import itertools





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

A = []
for i in range(k):
    d = input()
    A.append(tuple(map(int, input().split())))

c = list(itertools.chain.from_iterable(A))
ans1 = collections.Counter(c)

print(n-len(ans1))

Solution (Python):
n,k= list(map(int, input().split()))
z=[0]*n
ans=0
for j in range(k):
    q=int(input())
    i = list(map(int, input().split())) 
    for h in range(len(i)):
        z[i[h]-1]+=1
for u in range(n):
    if z[u]==0:
        ans+=1
print(ans)

Solution (Python):
n,k=map(int, input().split())
ad=[list(map(int,input().split()))  for _ in range(k*2)]
d=[]
a=[]
ans=0
kashi=[1 for _ in range(n)]

for i in range(0,len(ad),2):
    d.append(ad[i])
for j in range(1,len(ad),2):
    a.append(ad[j])

for i in range(len(a)):
    for j in range(len(a[i])):
        kashi[a[i][j]-1]=0

ans=sum(kashi)
print(ans)

Solution (Python):
import numpy
N,K = map(int,input().split())
a= [input().split() for l in range(2*K)]
b=a[1::2]

k=[0]*N
for i in range(K) :
    for j in range(N):
        if (b[i].count(str(j+1))) > 0 :
            k[j]+=1

count=0
for i in range(N):
    if k[i]==0:
        count+=1

print(count)

Solution (Python):
n,k=map(int,input().split())
lst1=list(map(lambda x: x+1,range(n)))
lst2=[]
for i in range(k):
    d = int(input())
    r = list(map(int,input().split()))
    lst2 = lst2 + r
lst2 = list(set(lst2))
for i in lst2:
    lst1.remove(i)
print(len(lst1))

Solution (Python):
population, kind = map(int,input().split())
lists = [0] * population
i = 0

while i <= kind -1:
  i += 1
  zaiko = int(input())
  j = 0
  posess = list(map(int,input().split()))
  while j <=  zaiko -1:
    lists[posess[j] - 1] = 1
    j += 1

k = 0
count = 0
while k <= population-1:
  if lists[k] == 0:
    count += 1
  k += 1

print(count)

Solution (Python):






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



sum=0



List_A_all = list(range(3*K+1))
List_A_all =[]



for i in range(K):

    List_d = int(input())

    List_A = input().split()
    List_A_int= [int(s) for s in List_A]
    List_A_all.extend(List_A_int)



for t in range(N):
    if not t+1 in List_A_all:
        sum+=1



print(sum)

Solution (Python):
import itertools
N,K = map(int,input().split())
d=[]
A=[]
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int,input().split())))
answer=N-len(set(itertools.chain.from_iterable(A)))
print(answer)

Solution (Python):
N,K =map(int,input().split())
L=[]
for i in range(1,K+1):
    d = int(input())
    L1=list(map(int,input().split()))
    for j in L1:
        if not j in L:
            L.append(j)
print(N-len(set(L)))

Solution (Python):
n, k =map(int,input().split())
A = [0]*(n+1)
t = 0
for _ in range(k) :
  d = int(input())
  a = list(map(int,input().split()))
  set(a)
  while t < d :
    A[a[t]] += 1
    t += 1
  t = 0
    
print(A.count(0) - 1)

Solution (Python):
a = input().split()

n = int(a[0])
k = int(a[1])

ar = [0]*(2*k)
ss = [0]*n

for i in range(0,k*2):
  ar[i] = input().split()
  
for i in range(0,len(ar)):
  if(i%2==0):
    del ar[i][:]

for i in range(0,len(ar)):
  if(len(ar[i]) == 0):
    continue
  else:
    if(len(ar[i]) == 1):
      x = int(ar[i][0]) - 1
      ss[x] += 1 
    else:
      for j in range(0,len(ar[i])):
        x = int(ar[i][j]) - 1
        ss[x] += 1 

print(ss.count(0))

Solution (Python):
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)

Solution (Python):
n,k=(int(x) for x in input().split())
hito = []
d = []
A = []
for i in range(1,n+1):
  hito.append(i)
for j in range(1,k+1):
  d = int(input())
  newa = input().split()
  for m in range(0,d):
    A = int(newa[m])
    if A in hito:
      hito.remove(A)
print(len(hito))

Solution (Python):
N,K = map(int, input().split())
arr1=[]
arr=[]
for i in range(1, N+1):
  arr1.append(i)

for i in range(K*2):
  A=list(map(int, input().split()))
  if i%2!=0:
    arr = arr+A
print(len(list(set(arr1) - set(arr))))

Solution (Python):
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")


def main():
    N, K = map(int, input().split())
    N_list = [1 for x in range(N)]
    s_list = [x for x in range(1, N)] 
    
    for i in range(K):
        di = int(input())
        A_i = list(map(int, input().split()))
        for j in A_i:
            N_list[j - 1] = 0

    print(N_list.count(1))
    
if __name__ == "__main__":
    main()

Solution (Python):
Q = input().split(" ")
N = int(Q[0])
K = int(Q[1])
A = {}
ss = 0
for i in range (N):
  A[str(i +1)] = 0
for i in range(K):
  a = int(input())
  b = input().split(" ")
  for j in range(a):
    A[b[j]] = 1
    



for v in A.values():
  
  if v == 0:
    ss += 1
print(ss)

Solution (Python):
N, K = input().split()
N = int(N)
K = int(K)
snk = [1] * N

for i in range(K):
    _ = input()
    a = input().split()
    for j in a:
        snk[int(j)-1] = 0

print(sum(snk))

Solution (Python):
def main():
    n,k = (int(x) for x in input().split())
    ans = []
    for i in range(k):
        d = int(input())
        A = [int(x) for x in input().split()]
        ans += A
    ans = set(ans)
    print(n-len(ans))

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import collections
import itertools





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

A = []
for i in range(k):
    d = input()
    A.append(tuple(map(int, input().split())))

c = list(itertools.chain.from_iterable(A))
ans1 = collections.Counter(c)

print(n-len(ans1))

Solution (Python):
import itertools

def main():
  n, k = map(int, input().split())
  d_li = []
  a_li = []
  for i in range(k):
    d_li.append(int(input()))
    a_li.append(list(map(int, input().split())))

  res = itertools.chain(*a_li)
  res = list(res)
  print(n-len(list(set(res))))

if __name__ == '__main__':
  main()

Solution (Python):
n, k = map(int, input().split())
snak = [False] * n
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for j in a:
        snak[j - 1] = True
ans = 0
for i in snak:
    if not i:
        ans += 1
print (ans)

Solution (Python):
N, K = map(int, input().split())
has_snack = set()
for _ in range(K):
    input()
    has_snack = has_snack.union(map(int, input().split()))
print(N - len(has_snack))

Solution (Python):
N,K = map(int,input().split())
S = set(i for i in range(1,N+1))
for i in range(K):
  d = int(input())
  S2 = set(map(int,input().split()))
  S = S - S2
print(len(S))

Solution (Python):
N, K = map(int, input().split())

l = [1] * N

for i in range(K):
  a=input()
  A = list(map(int, input().split()))
  for j in A:
    l[j-1]=0
print(sum(l))

Solution (Python):
n,k=map(int,input().split())
d=[];a=[];s=[0]*n
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
for i in range(k):
    for z in a:
        for x in z:
            s[x-1]+=1
print(s.count(0))

Solution (Python):
N,K =map(int , input().split())
A = []
for i in range(K):
  d = int(input())
  A += map(int , input().split())
print(N-len(set(A)))

Solution (Python):
N, K = map(int, input().split())
list_d_i = []
for i in range(K):
	d = int(input())
	list_d_i.extend(list(map(str, input().split())))

import collections as c

cnt_l = c.Counter(list_d_i)

print(N-len(cnt_l.keys()))

Solution (Python):
n,k = map(int,input().split())
freq = [0] * n
for _ in range(k):
	d = int(input())
	l = list(map(int,input().split()))
	for i in l:
		freq[i-1] += 1
count = 0
for i in freq:
	if i==0:
		count += 1
print(count)

Solution (Python):
a = list(map(int, input().split()))
b = list(range(a[0]+1))
d = []
A = []

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

B = set(A)
print(a[0]-len(B))

Solution (Python):
from sys import stdin
import sys
import math

N, K = list(map(int, stdin.readline().rstrip().split()))

d = []
A = []
n = {}
for i in range(K):
    d.append(int(input()))
    
    tmp = list(map(int, stdin.readline().rstrip().split()))
    A.append(tmp)
    for a in tmp:
        n[a] = 1

count = 0
for j in range(1, N+1):
    if n.get(j, 0) == 0:
        count += 1

print(count)

Solution (Python):
N,K=map(int,input().split())
A=[]
for i in range(2*K):
  A.append(input().split())
B=list(A[1::2])
C=[]
for i in range(K):
  C+=B[i]
  
print(N-len(list(set(C))))

Solution (Python):
def main():

    n,k = map(int,input().split())
    l = [0] * n
    for i in range(k):
        d = int(input())
        listA=list(map(int,input().split()))
        for j in range(d):
            l[listA[j]-1] += 1

    print(l.count(0))

if __name__ == "__main__":
    main()

Solution (Python):
NK=list(map(int,input().split()))
a=[]
for _ in range(NK[1]):
    NUM=input()
    oyatsyumochi=list(map(int,input().split()))
    a.extend(oyatsyumochi)

have=set(a)

ans=NK[0]-len(have)
print(ans)

Solution (Python):
n,k = map(int,input().split())
d = [0]*k
a = [0]*k
s = []
for i in range(k):
    d[i] = int(input())
    a[i] = list(map(int,input().split()))
    s.extend(a[i])
d = set(s)
print(n-len(d))

Solution (Python):
n,k =map(int,input().split())


b=[int(i) for i in range(1,n+1)]


for i in range(k):
    d = int(input())
    a =[int(x) for x in input().split()]
           
    for j in (a):
        if j in b:
            b.remove(j)

print(len(b))

Solution (Python):
NK = list(map(int,input().split()))

N = NK[0]
K = NK[1]

Ad = [list(map(int,input().split())) for l in range(K*2)]

A = []

for i in range(1,len(Ad)+1,2):
    A.extend(Ad[i])
    
set_A = set(A)

members = []

for i in range(1,N+1):
    members.append(i)

set_M = set(members)

print(len(set_M - set_A))

Solution (Python):
n, k = map(int, input().split())
d = [0] * k
sunuke = {}
for i in range(n):
    sunuke.setdefault(str(i),0)
for i in range(n):
    sunuke[str(i)] = 0

for i in range(k):
    d[i] = int(input())
    A = list(map(int, input().split()))
    for j in range(d[i]):
        sunuke[str(A[j]-1)] += 1
ans = list(sunuke.values()).count(0)
print(ans)

Solution (Python):

N, K = map(int, input().split())
acc = set()
for i in range(1, K+1):
	
	_ = int(input())
	for A in map(int, input().split()):
		acc.add(A)
print(N-len(acc))