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):
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()
N,K=map(int,input().split())
sunuke=[0 for i in range(N)]
for k in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for i in range(d):
        sunuke[A[i]-1]+=1

print(len([i for i in sunuke if not i]))

Solution (Python):
N, K = map(int, input().split())
ans = [0 for i in range(N)]

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

print(len([i for i in ans if i == 0]))

Solution (Python):
from collections import Counter
N,K = map(int,input().split(" "))
sunuke = [0]*N
for _ in range(K):
    d = int(input())
    for i in [int(i) for i in input().split(" ")]:
        sunuke[i-1] += 1

C = Counter(sunuke)
print(C[0])

Solution (Python):

n, k = map(int, input().split())
ds = [0] * k
As = [0] * n

for i in range(k):
    ds[i] = input()
    A = list(map(int, input().split()))
    for a in A:
        As[a - 1] += 1
ans = 0
for A in As:
    if (A == 0):
        ans += 1

print(ans)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  
def Is(): return map(int, input().split())  
def LI(): return list(map(int, input().split()))  
def TI(): return tuple(map(int, input().split()))  
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  
def LS(): return list(input())  
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

N, K = Is()
S = [0]*N

for _ in range(K):
    d = I()
    A = LI()
    for i in A:
        S[i-1] += 1


ans = 0
for s in S:
    if s == 0:
        ans += 1

print(ans)

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

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

F = [0] * N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        F[a-1] += 1

c = 0
for x in F:
    if x == 0:
        c += 1
print(c)

Solution (Python):
num, okashi = map(int, input().split(" "))
snk = [1 for i in range(num)]
for i in range(okashi):
    ninnzuu = (int)(input())
    temp = list(map(int, input().split(" ")))
    for j in temp:
        snk[j - 1] = 0
print(sum(snk))

Solution (Python):
N, K = input().split()
N = int(N)
K = int(K)
Sunuke = set(range(N))
for i in range(K):
  d = int(input())
  X = list(map(int, input().split()))
  for x in X:
    Sunuke.discard(x-1)
print(len(Sunuke))

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

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

for s in sunuke:
    if s == 0:
        ans += 1

print(ans)

Solution (Python):
NK = input().split()
S = set()

N = int(NK[0])
K = int(NK[1])

for i in range(K):
    n = int(input())
    L = input().split()

    for x in L:
        if x in S:
            pass
        else:
            S.add(x)

print(N - len(S))

Solution (Python):
N, K = map(int, input().split())
ans = 0
sunuke_list = set()

for _ in range(K):
    d = int(input())
    A_list = list((map(int, input().split())))
    sunuke_list |= set(A_list)

for i in range(1, N + 1):
    if i not in sunuke_list:
        ans += 1

print(ans)

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

oksi_list = []

for i in range(K):
    d = int(input())
    oksi_list.extend(list(map(int, input().split())))
print(N - len(set(oksi_list)))

Solution (Python):
N,K=map(int,input().split())
a=[x for x in range(1,N+1)]
for i in range(K):
  d=input()
  A=list(map(int,input().split()))
  for j in A:
    if j in a:
      a.remove(j)
print(len(a))

Solution (Python):
N, K = map(int, input().split())
darega = [[] for _ in range(N)]
for i in range(K):
    _ = input()
    hito = map(int, input().split())
    for j in hito:
        darega[j-1].append(i+1)
ans = 0
for x in darega:
    if x == []:
        ans += 1
print(ans)

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

print(N - len(set(A)))

Solution (Python):
x = list(map(int,input().split(" ")))
n = x[0]
k = x[1]

sunlist = [0]*n
dlist = []
alist = []

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

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

sunlist_plus = [i for i in sunlist if i > 0]
sunlist_plus_len = len(sunlist_plus)
print(n-sunlist_plus_len)

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

a = set()
for i in range(k):
    _ = input()
    for j in list(map(int, input().split())):
        a.add(j)
    

print(n-len(a))

Solution (Python):
N, K = map(int, input().split())
snack = [False for i in range(N)]
for i in range(K):
    d = int(input())
    snack_k = [int(i) for i in input().split()]
    for j in snack_k:
        snack[j - 1] = True
sum = 0
for i in snack:
    if not i:
        sum += 1
print(sum)

Solution (Python):
n,k = map(lambda x:int(x),input().split())
snakhold = [0]*n
for i in range(k):
  snaknum = input()
  snakholders = list(map(lambda x:int(x),input().split()))
  for s in snakholders:
    snakhold[s-1] = 1
victim = 0
for s in snakhold:
  if s==0:
    victim += 1
print(victim)

Solution (Python):


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

    sunukes = [0 for _ in range(N)]
    for k in range(K):
        d = int(input())
        As = list(map(int, input().split()))
        for a in As:
            a = a-1
            sunukes[a] = 1

    ans = N - sum(sunukes)
    print(ans)


if __name__ == "__main__":
    solve()

Solution (Python):
N, shurui = map(int, input().split())
ls_n = []
ls = []

set_ls = set()

for i in range(shurui):
  ls_n.append(int(input()))
  tmp = list(map(int, input().split()))
  for t in tmp:
    set_ls.add(t)


print(N - len(set_ls))

Solution (Python):




import sys
from io import StringIO
import unittest

def yn(b):
    print("Yes" if b==1 else "No")
    return

def resolve():
    readline=sys.stdin.readline

    n,k=map(int, readline().rstrip().split())
    

    dic={}
    for i in range(k):
        d=int(readline())
        arr=list(readline().rstrip().split())
        for a in arr:
            dic[a]=1
    ans=n-len(dic.keys())
    print(ans)
    
    

    return

if 'doTest' not in globals():
    resolve()
    sys.exit()

Solution (Python):

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

all_snucks = set(i for i in range(1, n + 1))

for snack in range(1, k + 1):
    d = int(input())
    snucks = map(int, input().split())

    for snuck in snucks:
        if snuck in all_snucks:
            all_snucks.remove(snuck)

print(len(all_snucks))

Solution (Python):
n, k = map(int, input().split())
d = []
A = []
ans = []
for i in range(k):
    hoge = int(input())
    tmp = list(map(int, input().split()))
    d.append(hoge)
    A.append(tmp)

for i in range(1, n+1):
    for j in range(len(A)):
        if i in A[j] and i not in ans:
            ans.append(i)
cnt = 0
for i in range(1, n+1):
    if i not in ans:
        cnt += 1

print(cnt)

Solution (Python):
s = input()

N = int(s.split()[0])
K = int(s.split()[1])

have = []

for i in range(K):
  d = int(input())
  A = input().split()
  for k in range(d):
    have.append(int(A[k]))

result = 0
    
for i in range(N):
  if (i+1) not in have:
    result += 1
    
print(result)

Solution (Python):
n,k=map(int,input().split())
a=set()
for i in range(k):
    d=int(input())
    tmp=[int(i) for i in input().split()]
    for j in range(d):
        a.add(tmp[j])
ans=n-len(a)
print(ans)

Solution (Python):
N, K = [int(i) for i in input().strip().split()]
sunuke = set([])
for i in range(K):
  d = int(input().strip())
  ai = [int(a) for a in input().strip().split()]
  sunuke |= set(ai)
print(N-len(sunuke))

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())))
def search(A,i):
    for j in range(0,len(A)):
        for k in range(0,len(A[j])):
            if A[j][k] == i:
                return False
    return True
ans = 0
for i in range(1,N+1):
    if search(A,i):
        ans += 1
print(ans)

Solution (Python):


def main():
    NK = list(map(int,input().split()))


    count = [0] * NK[0]

    for i in range(NK[1]):
        d = int(input())
        di = list(map(int,input().split()))
        for g in range(d):
            count[di[g]-1] += 1


    print(count.count(0))







if __name__ == '__main__':
    main()

Solution (Python):
d = list(map(int,input().split()))
N = d[0]
K = d[1]

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

Solution (Python):
n,k = map(int, input().split())
hs = [False]*n
for _ in range(k):
  d = int(input())
  s = [int(i) for i in input().split()]
  for p in s:
    if not hs[p-1]:
      hs[p-1]=True
res=0
for i in range(n):
  if not hs[i]:
    res+=1
print(res)

Solution (Python):

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

    ds = []
    current_members = set(range(1,N+1))
    for i in range(K):
        d = int(input())
        members= map(int, input().split())
        current_members -= set(members)
    
    
    print(len(current_members))


if __name__ == '__main__':
    main()

Solution (Python):
N, K = list(map(int, input().split()))
sunukes = set([n for n in range(1, N+1)])
for k in range(K):
    dk = int(input())
    Ak = set(list(map(int, input().split())))
    sunukes = sunukes - Ak
print(len(sunukes))

Solution (Python):
n,k=map(int,input().split())
list_1=[]
for _ in range(n):
    list_1.append(0)


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


print(list_1.count(0))

Solution (Python):
import sys
import os

def file_input():
    f = open('../Beginner_Contest_166/input.txt', 'r')
    sys.stdin = f

def main():
    

    N,K=map(int, input().split())
    has_k=[False]*N
    count=0

    for i in range(K):
        d=int(input())
        A=list(map(int,input().split()))
        for a in A:
            if not has_k[a-1]:
                
                has_k[a-1]=True
                count+=1

    print(N-count)


if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
f_list = [0] * N
for _ in range(K):
  d = int(input())
  a_list = list(map(int, input().split()))
  for a in a_list:
    f_list[a-1] += 1

ans = 0
for f in f_list:
  if f == 0:
    ans += 1
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline




'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(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())))

nn=[i for i in range(1,n+1)]
for i in range(k):
    for j in range(d[i]):
        
        if a[i][j] in nn:
            nn[a[i][j]-1]=0


cnt=0
for i in range(len(nn)):
    if nn[i]!=0:
        cnt+=1
print(cnt)

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

Solution (Python):
import sys

N, K = map(int, sys.stdin.readline().split())
d = []
A = []
for i in range(K):
    temp_d = int(sys.stdin.readline())
    temp_A = list(map(int, sys.stdin.readline().split()))
    d.append(temp_d)
    A.append(temp_A)

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

sss = []
for i in A:
    for j in i:
        sss.append(j)

print(N - len(set(sss)))

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

l = [1] * N

for _ in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        l[a - 1] = 0

print(sum(l))

Solution (Python):
import math

def resolve():
    N, K= map(int, input().split())
    A_list = []
    ans_list = []

    for i in range(K):
        d = int(input())
        a_list = list(map(int, input().split()))
        A_list.append(a_list)
        for j in a_list:
            ans_list.append(j)

    print(N - len(set(ans_list)))


if __name__ == "__main__":
    resolve()

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

s = set()

for i in range(k):
    d = int(input())
    p = map(int, input().split())
    for j in p:
        s.add(j)

print(n-len(s))

Solution (Python):
N, K = map(int, input().split())
A = []
ans = 0

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

A.sort

for k in range(1, N+1):
  if k in A:
    continue
    
  else:
    ans += 1
        
print(ans)

Solution (Python):
N, K = list(map(int, input().split()))
arr = []
for i in range(K):
    C = int(input())
    A = list(map(int, input().split()))
    for ele in A:
        if ele not in arr:
            arr.append(ele)

print(N-len(arr))

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

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

d_list = []
a_list = []
for k_tmp in range(k):
    d_tmp=int(input())
    d_list.append(d_tmp)
    a_list_tmp = list(map(int,input().split()))
    a_list.append(a_list_tmp)

ans_set = set()
for i in range(len(a_list)):
    for j in range(len(a_list[i])):
        ans_set.add(a_list[i][j])

print(n - len(ans_set))

Solution (Python):
a = list(map(int,input().split()))
n = a[0]
k = a[1]
su = []
for j in range(n):
  su.append(0)
for i in range(k):
  d = int(input())
  b = list(map(int,input().split()))
  for l in range(d):
    count=b[l]
    su[count-1]=1
print(su.count(0))

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

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

b={i:0 for i in range(1,n+1)}

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

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

Solution (Python):


def main():
    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 A:
            sunuke[j-1] += 1
    
    print(sunuke.count(0))



if __name__ == '__main__':
    main()

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

for i in range(k):
    d = input()
    b = set(list(map(int, input().split())))
    a |= b

print(n - len(a))

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

while True:
    try:
        d.append(int(input()))
        a.append(list(map(int,input().split())))
    except:
        break
        
anslist = [0]*n
cnt = 0
for i in range(k):
    for j in range(d[i]):
        anslist[a[i][j]-1] +=1
        
for i in anslist:
  if i==0:
    cnt +=1
print(cnt)

Solution (Python):

import sys
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def main():
    N,K = MAP()
    have = [False]*N

    for i in range(K):
        d = INT()
        A = LI()

        for a in A:
            have[a-1] = True
    
    answer = 0
    for i in range(N):
        if not have[i]:
            answer += 1
    print(answer)


if __name__ == '__main__':
    main()

Solution (Python):
if __name__ == "__main__":
    n, k = [int(i) for i in input().split()]
    a_list = [False] * n
    for i in range(k):
        v = int(input())
        for j in input().split():
            a_list[int(j)-1] = True

    ans = len([i for i in a_list if i == False])
    print(ans)

Solution (Python):
n,k=map(int, input().split())
s = set()
for i in range(k):
  d=int(input())
  c=list(map(int, input().split()))
  for j in range(d):
    s.add(c[j])
    
print(n-len(s))

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

A=[]

for _ in range(K):
    di=int(input())
    
    A_t=list(map(int,input().split()))
    for i in range(di):
        A.append(A_t[i])    

print(N-len(set(A)))

Solution (Python):
n,k = map(int,input().split())
hoge = []
cnt = 0
for i in range(k):
    d = int(input())
    c = list(map(int,input().split()))
    for i in range (len(c)):
        hoge.append(c[i])
for i in range (n):
    if i+1 in hoge:
        cnt += 0
    else:
        cnt += 1
print(cnt)

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

for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for i in range(len(a)):
        dic[a[i]-1] = 1

for i in range(len(dic)):
    if dic[i] == 0:
        ans += 1

print(ans)

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

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

for i in range(k):
    _ = input()
    A = list(map(int,input().split()))
    
    for j in A:
        j -= 1
        ANS[j] += 1
        
print(ANS.count(0))

Solution (Python):
N, K = (int(x) for x in input().split())
list = [0] * N

for i in range(K):
    d = int(input())
    for j in (int(x) for x in input().split()):
        list[j-1] = 1
count = 0
for i in list:
    if i == 0:
        count += 1
print(count)

Solution (Python):
def main():
    n, k = [int(e) for e in input().split()]
    D = []
    A = []
    for i in range(k):
        D.append(input())
        A.append([int(e) for e in input().split()])

    S = set()
    for Aa in A:
        S = S.union(Aa)

    print(n - len(S))


if __name__ == '__main__':
    main()

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

A = [0] * N

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

ans = 0
for i in range(len(A)):
    if A[i] == 0:
        ans += 1

print(ans)

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

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())))
counter = [0] * N
for i in range(K):
    for j in range(d[i]):
        counter[A[i][j] - 1] += 1
ans = 0
for a in counter:
    if a == 0:
        ans += 1
print(ans)

Solution (Python):
n, k = map(int, input().split())
aly = [0 for i in range(n)]

for i in range(k):
    d = int(input())
    lst = list(map(int, input().split()))
    for num in lst:
        aly[num - 1] = 1

print(aly.count(0))

Solution (Python):
n,k=map(int,input().split(" "))
a=[0 for i in range(n)]
g=0
for i in range(k):
  d=int(input())
  A=input().split(" ")
  for j in range(d):
    if a[int(A[j])-1]==0:
      a[int(A[j])-1]=1
      g=g+1
print(n-g)

Solution (Python):
n, k = map(int, input().split())
d = [0]*k
a = [0]*n
for i in range(k):
    d[i] = int(input())
    b = list(map(int, input().split()))
    for i in b:
        a[i-1] += 1

flag = 0
for i in a:
    if i == 0:
        flag += 1
        
print(flag)

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def input(): return sys.stdin.readline().rstrip()

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

  ary = set([i+1 for i in range(N)])
  mem = set([])
  for i in range(K):
    sumN = int(input())
    for i in list(map(int, input().split())):
      mem.add(i)

  print(len(ary - mem))

if __name__ == '__main__':
  main()

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

sunuke = []
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        if not A[j] in sunuke:
            sunuke.append(A[j])

print(N - len(sunuke))

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

Solution (Python):
n,k = map(int,input().split())
cnt = 0
on = [0] * n
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    
    for j in a:
        on[j - 1] += 1

for l in on:
    if l == 0:
        cnt += 1

print(cnt)

Solution (Python):
n,k=map(int,input().split())
a=[]
d=[]
for i in range(k):
  di=int(input())
  ai=list(map(int,input().split()))
  d.append(di)
  a.append(ai)
c=[0]*n
for i in range(k):
  for j in range(len(a[i])):
    c[a[i][j]-1]+=1
cnt=0
for i in range(n):
  if c[i]==0:
    cnt+=1
print(cnt)

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

a = [0] * n
for i in range(k):
    d = int(input())
    s = list(map(int, input().split()))
    for m in range(0, d):
        a[s[m] - 1] = 1
print(a.count(0))

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

s = [0]*n

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

print(s.count(0))

Solution (Python):

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

d = []
A = []
for i in range(K):
    d_ = int(input())
    A_ = list(map(int, input().split()))
    d.append(d_)
    A.append(A_)

import numpy as np

S = np.zeros(N)
for i in A:
    for j in i:
        S[j-1] += 1
    
count = 0
for i in S:
    if i == 0:
        count += 1
    
print(count)

Solution (Python):
from collections import Counter
n,k = list(map(int,input().split()))
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.extend(list(map(int,input().split())))
print(n - len(list(Counter(a))))

Solution (Python):
n, k = map(int, input().split())
b = set()
for i in range(k):
    a = int(input())
    b |= set(map(int, input().split()))
print(n - len(b))

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

sunuke = [1]*n
for i in range(k):
  d = int(input())
  motterus = list(map(int, input().split()))
  for motteru in motterus:
    sunuke[motteru-1] = 0
 
print(sum(sunuke))

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

Solution (Python):




def main():

    
    first_input = list(map(lambda x:int(x), input().split(" ")))
    

    
    
    

    
    

    N = first_input[0]
    K = first_input[1]

    sunuke_list = [0]*N
    for i in range(K):
        _dummy = input()
        current_input = list(map(lambda x:int(x), input().split(" ")))
        for j in current_input:
            sunuke_list[j-1] = 1

    print(N-sum(sunuke_list))

if __name__ == '__main__':
    main()

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n, k = map(int, input().split())
has = set()
for _ in range(k):
    input()
    has.update(map(int, input().split()))

no_has = set(range(1, n+1)) - has
print(len(no_has))

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

sunuke = [0]*N
okashi = []

for i in range(K):
    gomi = input()
    temp = input().split()
    okashi.append(temp)
    
    


for i in range(len(okashi)):
    for j in okashi[i]:
        sunuke[int(j) - 1] += 1
        

count = 0

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

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())))

snk = [0]*n

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

c = 0
for i in range(n):
	if snk[i] == 0:
		c += 1

print(c)

Solution (Python):
from collections import deque

def main():
    dictionary={}
    N,K=map(int,input().split())
    for i in range(K):
        d=int(input())
        A=[int(x) for x in input().split()]
        for num in A:
            if num in dictionary:
                dictionary[num]+=1
            else:
                dictionary[num]=1
                
     
    d=deque()            
    for key in sorted(dictionary.keys()):
        d.append(key)
    
    print(N-len(d))
    
if __name__=="__main__":
    main()

Solution (Python):
N, K = map(int, input().split())
child = [0 for i in range(N)]
d = []
trick = []

for i in range(K):
    d.append(int(input()))
    trick.append(input().split())

for i in range(K):
    tmp = d[i]
    for j in range(tmp):
        child[int(trick[i][j]) - 1] += 1
        
print(child.count(0))

Solution (Python):
n,k=map(int,input().split())
a=[]
c=[1]*n
for i in range(k):
  input()
  a=a+input().split()
for j in range(n):
  if a.count(str(j+1))>0:
    c[j]=0
print(sum(c))

Solution (Python):
[n,k]=list(map(int,input().split()))
dlist=[]
alists=[]
for i in range(k):
    dlist.append(int(input()))
    alists.append(list(map(int,input().split())))

okashi=[0]*n
for i in range(k):
    for j in alists[i]:
        if okashi[j-1]==0:
            okashi[j-1]=1

ans=0
for i in range(n):
    if okashi[i]==0:
        ans+=1

print(ans)

Solution (Python):
def resolve():
    N, K = map(int, input().split())
    C = [0] * N
    for i in range(K):
        input()
        A = list(map(int, input().split()))
        for a in A:
            C[a-1] += 1

    print(C.count(0))

if __name__ == '__main__':
    resolve()

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

A = [0] * N

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

ans = 0
for i in range(len(A)):
    if A[i] == 0:
        ans += 1

print(ans)

Solution (Python):
def b166(n, k):

    count = []
    for i in range(k):
        d = int(input())
        al = []
        a = 0
        if d == 1:
            a = int(input())
            count.append(a)
        else:
            al = list(map(int, input().split()))
            for w in al:
                count.append(w)

    return n - len(set(count))

def main():
    n, k = map(int, input().split())
    print(b166(n, k))

if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
d=[]
A=[]

for i in range(K):
    hoge = int(input())
    d.append(hoge)
    hoge = list(map(int, input().split()))
    for k in hoge:
        A.append(k)

A=set(A)
n=len(A)

print(N-n)

Solution (Python):




import sys
input = sys.stdin.readline



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

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

    have = set([])

    for i in range(K):
        have = have | set(A[i])

    all = set([i for i in range(1,N+1)])

    trick = all - have

    print(len(trick))



main()

Solution (Python):
"""
import random
import functools
import copy
import bisect
import array
import re
import collections
import heapq
import fractions
import itertools
import string
import math
from operator import itemgetter as ig
from bisect import bisect_left, bisect_right, insort_left, insort_right
from itertools import permutations, combinations, product, accumulate, groupby
from heapq import heappush, heappop
from collections import deque, defaultdict, Counter
import sys
sys.setrecursionlimit(10 ** 7)


inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]
ddn9 = ddn + [(0, 0)]
'''for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:'''
"""
from operator import itemgetter
from collections import defaultdict
import sys
import math
sys.setrecursionlimit(10 ** 7)


def wi(): return list(map(int, sys.stdin.readline().split()))



def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]


def ws(): return sys.stdin.readline().split()


def si(): return int(sys.stdin.readline())  


def ss(): return input()


def hi(n): return [si() for _ in range(n)]


def hs(n): return [ss() for _ in range(n)]  


def s_list(): return list(input())


def mi(n): return [wi() for _ in range(n)]  


def mip(n): return [wip() for _ in range(n)]


def ms(n): return [ws() for _ in range(n)]


def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[
    0]] for _ in range(n)]  


def grid(n): return [s_list() for _ in range(n)]


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a




def round_up(a, b):
    """ a/b の切り上げ """
    c = (a + b - 1) / b
    return c


def lcm(a, b):
    """a,bの最小公倍数"""
    return a * b // gcd(a, b)


def floor(a, b):
    """floor(a/b) 整数値を返す"""
    c = (a - a % b)/b
    return int(c)


def main():
    n, k = wi()
    d = []
    a = []
    b = []
    cnt = 0
    for i in range(k):
        d = int(input())
        a.append(wi())
    for i in range(k):
        for j in a[i]:
            if j in b:
                continue
            else:
                b.append(j)
                cnt += 1
    print(n-cnt)


if __name__ == '__main__':
    main()

Solution (Python):
n,k=map(int,input().split())
ans=[None]*n
while k>0:
  d=input()
  a=list(map(int,input().split()))
  
  for i in a:
    ans[i-1]=d
  k-=1
count=0
for item in ans:
  if item==None:
    count+=1
print (count)

Solution (Python):
n,k=map(int,input().split())
l=[0 for i in range(n)]
for i in range(k):
    t=int(input())
    ar=list(map(int,input().split()))
    for j in range(t):
        l[ar[j]-1]+=1
val=0
for i in range(n):
    if(l[i]==0):
        val=val+1
print(val)

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

have_treat = list()

for _ in range(k):
    _ = input()
    have_treat.extend(list(map(int,input().split())))

print(n-len(set(have_treat)))

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

a = [1] * n

for i in range(k):
  d = int(input())
  t = [num for num in map(int, input().split())]
  for j in range(d):
    idx = t[j]-1
    a[idx] = 0

print(sum(a))