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

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

ans = n - int(len(set(l)))
print(ans)

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

print(len([i for i,x in enumerate(S) if x==0]))

Solution (Python):
N, K = list(map(int,input().split()))
d_list = []
A_list = []

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

for i in range(K):
  d = int(input())
  A_list = list(map(int,input().split()))
  for j in range(len(A_list)):
    if(A_list[j] in result):
      result.remove(A_list[j])

print(len(result))

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

set_all = set()
for i in range(k):
    input()
    set_all = set_all.union(set(list(map(int, input().split()))))
print(n - len(set_all))

Solution (Python):
n,k=map(int,input().split())
ki=[]
ai=[]
for i in range(1,k+1):
  ki.append(int(input()))
  ai.append(list(map(int,input().split())))

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

for i in range(1,k+1):
  for j in range(len(ai[i-1])):
    if ai[i-1][j-1] in s:
      s.remove(ai[i-1][j-1])
    
print(len(s))

Solution (Python):
import math
import collections

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






ans=0
b=list()
for i in range(K):
    X = int(input())
    a = list(map(int, input().split()))
    b+=a
for i in range(1,N+1):
    if not i in b:
        ans+=1
print(ans)

Solution (Python):


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



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



ans=0

for i in range(N):
    
    flg=0
    for j in range(K):
        
        if str(i+1) in list[j]:
            
            flg = 1
    if flg == 0:
        ans=ans+1

print(ans)

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

lis = [0] * n

for i in range(k):
    num = int(input())
    dos = list(map(int, input().split()))
    for k in range(num):
        lis[dos[k]-1] += 1

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

Solution (Python):

import numpy as np

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

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

z = np.ones(N)
for i in range(K):
  for j in range(d[i]):
    z[A[i][j]-1] = 0

print(int(z.sum()))

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

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

Solution (Python):
n, k = map(int, input().split())
da = [list(map(int, input().split())) for _ in range(2*k)]
ans = []
for i in range(1,2*k,2):
    ans += da[i] 
print(n-len(set(ans)))

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

snakes = [[] for i in xrange(n + 1)]

for i in xrange(k):
    s = int(raw_input())
    ns = map(int, raw_input().split())

    for num in ns:
        snakes[num].append(s)

tot = 0
for i in xrange(1, n + 1):
    if not snakes[i]:
        tot += 1
print tot

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

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

def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def LI(): return list(map(int,input().split()))
def TI(): return tuple(map(int,input().split()))
def RN(N): return [input().strip() for i in range(N)]


def main():
    N, K = MI()
    d = [0]*K
    A = [0]*K
    for i in range(K):
        d[i] = II()
        A[i] = LI()
    Alist = []
    for i in range(K):
        for j in range(d[i]):
            Alist.append(A[i][j])
    print(N-len(set(Alist)))


if __name__ == "__main__":
	main()

Solution (Python):
n,k=map(int,input().split())
List=[]
for i in range(k):
    di=int(input())
    Li=list(map(int,input().split()))
    List=List+Li
s=set(List)
print(n-len(s))

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

NA = [0] * N

for c in range(M):
    d =  int(input())
    A = input().split()

    for b in A:
        NA[int(b)-1] = 1

ANS = 0

for d in NA:
    if d == 0:
        ANS += 1

print(ANS)

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

li = []

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

list = list(set(li))
print(n-len(list))

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

ans = [0]*(N+1)

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

res = len(ans)-1-sum(ans)
print(res)

Solution (Python):
l=[]

N,K=(int(x) for x in input().split())

for i in range(K):
    d=int(input())
    A=list(map(int, input().split()))
    l.extend(A)

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

a=len(set(l))
b=len(set(j))
print(b-a)

Solution (Python):
n,k=map(int,input().split())
list_all=list(range(1,n+1))
for i in range(k):
    num=int(input())
    List=list(map(int,input().split()))
    for j in List:
        if j in list_all:
            list_all.remove(j)

print(len(list_all))

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

Solution (Python):
N, K = map(int, input().split())
user_have_sweets = []
for i in range(K):
    __sweets_number = input()
    li = list(map(int, input().split()))
    user_have_sweets.extend(li)

counta = 0
for i in range(1, N+1):
    if i in user_have_sweets:
        pass
    else:
        counta += 1

print(counta)

Solution (Python):
N, K = map(int, input().split())
list_A = [1]*N
for i in range(K):
    d = int(input())
    l = list(map(int, input().split()))
    for j in range(d):
        if list_A[l[j]-1]  == 1:
            list_A[l[j]-1]  = 0

print(list_A.count(1))

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

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

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

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

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

print(N - len(set(sum(a,[]))))

Solution (Python):
n, k = map(int, input().split())
okasi = [0] * k
sunuke = [0] * n
for i in range(k):
    okasi[i] = int(input())
    work = list(map(int, input().split()))
    for j in range(okasi[i]):
        sunuke[work[j] - 1] += 1
print(sunuke.count(0))

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

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

print(mask.count(False))

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

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

c = collections.Counter(A_list)

print(N-len(c))

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

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

s = set()
for _ in range(k):
    d = int(input())
    s |= set(map(int, input().split()))
print(n-len(s))

Solution (Python):
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))

x = inpl()
N = []
cnt = 0
for i in range(0, x[0]):
    N.append(0)

for i in range(0, x[1]):
    tem = int(input())
    A = inpl()

    for j in range(0, tem):
        N[A[j]-1] += 1

for k in range(0, len(N)):
    if N[k] == 0:
        cnt += 1

print(cnt)

Solution (Python):
N, K = list(map(int, input().split()))
data = [input().split() for _ in range(K*2)]
all_list = list(range(1,N+1))
have = []
for i in range(0,K):

    have.extend(data[1+2*i])

int_have = [int(n) for n in have]
sethave = list(set(int_have))

ans = list(set(all_list) - set(sethave))
print(len(ans))

Solution (Python):
if __name__=='__main__':
    n,k = map(int,input().split())
    have_okasi = [False for i in range(n)]
    for i in range(k):
        d = int(input())
        a = [int(x) for x in input().split()]
        for j in range(d):
            have_okasi[a[j]-1] = True
    print(have_okasi.count(False))

Solution (Python):
import sys
from random import choice,randint
inp=sys.stdin.readline
out=sys.stdout.write
flsh=sys.stdout.flush
 
sys.setrecursionlimit(10**9)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
 
def MI(): return map(int, inp().strip().split())
def LI(): return list(map(int, inp().strip().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines().strip()]
def LI_(): return [int(x)-1 for x in inp().strip().split()]
def LF(): return [float(x) for x in inp().strip().split()]
def LS(): return inp().strip().split()
def I(): return int(inp().strip())
def F(): return float(inp().strip())
def S(): return inp().strip()
def pf(s): return out(s+'\n')
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)

def main():
    n,k=MI()
    dc = dict()
    for i in range(k):
        d = I()
        a = LI()
        for i in range(len(a)):
            if a[i] not in dc:
                dc[a[i]]=1
            else:
                dc[a[i]]+=1
    c=0
    for i in range(1,n+1):
        if i not in dc:
            c+=1
    print(c)


if __name__ == "__main__":
    main()

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

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

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

for i in range(K):
    d = int(input())
    A = [int(_) for _ in input().split()]
    
    for a in A:
        if (a in N_list) == True:
            N_list.remove(a)

print(len(N_list))

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

    for i in range(K):
        d = int(input())
        a = list(map(int, input().split()))
        A += a

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



if __name__ == "__main__":
    b()

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

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


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

print(ans)

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

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


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

Solution (Python):
N, K = map(int, input().split())
sunuke = [False for _ in range(N)]
for k in range(K):
    _ = input()
    h = list(map(int, input().split()))
    for i in h:
        sunuke[i-1] = True
print(len([_ for s in sunuke if not s]))

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

List=set()
for i in range(K):
    d=int(input())
    if(d==1):
        List.add(input())
    else:
        tmp=input().split()
        for j in range(d):
            List.add(tmp[j])

print(N-len(List))

Solution (Python):
import sys
N, K = map(int, sys.stdin.readline().rstrip().split())
number = list(range(1, N+1))
lists = []
for i in range(K):
  d = sys.stdin.readline().rstrip()
  li = [int(x) for x in sys.stdin.readline().rstrip().split()]
  for k in li:
    if k in number:
      number.remove(k)
  lists.append(li)

print(len(number))

Solution (Python):
n,k = map(int, input().split())
sunuke = list(range(1,n+1))
for i in range(k):
  o = int(input())
  s = list(map(int, input().split()))
  sunuke = list(set(sunuke) - set(s))
print(len(sunuke))

Solution (Python):
import numpy as np
n, k = (int(x) for x in input().split())
d = np.zeros(k)
a = np.zeros(n)
for i in range(k):
    d[i] = int(input())
    a_s = (int(x) for x in input().split())
    for i_a, a_ss in enumerate(a_s):
        a[a_ss-1] += 1

print(np.count_nonzero(a == 0))

Solution (Python):
n,k=map(int,input().split())
l=[list(map(int,input().split())) for i in range(2*k)]
lk=l[1::2]
lk=sum(lk,[])
ls=list(set(lk))
ln=[i for i in range(1,n+1)]
a=0
for i in ln:
  if i not in ls:
    a+=1
print(a)

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

print(ans.count(0))

Solution (Python):
n,k = (int(i) for i in input().split())

belongs = [0] * n

for i in range(k):
	if 0 in belongs:
		d = int(input())
		a = [int(j) for j in input().split()]
		for j in range(d):
			belongs[a[j]-1] = 1

print(belongs.count(0))

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

AD = [list(map(int, input().split())) for i in range(2*NK[1])]

s = set()

for i in range(NK[1]):
    for j in AD[2*i+1]:
        s.add(j)

print(NK[0]-len(s))

Solution (Python):
import sys
import math

n, k = [int(x) for x in sys.stdin.readline().rstrip().split()]

ipt = sys.stdin.readlines()
li = [0 for x in range(n)]

for i in range(1, len(ipt), 2):
	for j in ipt[i].split():
		x = int(j)
		li[x - 1] += 1

print(li.count(0))

Solution (Python):


n,k = map(int, input().split())
ln = list(range(1,n+1))
di = 0
linei = []
for i in range(k):
    di = int(input())
    linei = list(map(int, input().split()))
    for j in linei:
        if j in ln:
            ln.remove(j)
print(len(ln))

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

given = []

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

num = 0
for i in range(1, n+1):
    if i not in given:
        num += 1
print(num)

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

Solution (Python):



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

d = [0]*K
A = [0]*N
Ak = [0]*K

for i in range(0,K):
    d[i]= input()
    d[i]= int(d[i])
    Ak[i] = input().split()
    Ak[i] = [int(s) for s in Ak[i]]
    for j in range(0,d[i]):
        A[Ak[i][j]-1] += 1
        
print(A.count(0))

Solution (Python):
import numpy as np
N, K = map(int, input().split())
lis = list(np.arange(1, N+1))
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        if A[j] in lis:
            lis.remove(A[j])
        else:
            continue
print(len(lis))

Solution (Python):
import sys, bisect, math, itertools, string, queue, copy


from collections import Counter,defaultdict,deque
from itertools import permutations, combinations
from heapq import heappop, heappush
from fractions import gcd

sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(input())
def inpm(): return map(int,input().split())
def inpl(): return list(map(int, input().split()))
def inpls(): return list(input().split())
def inplm(n): return list(int(input()) for _ in range(n))
def inplL(n): return [list(input()) for _ in range(n)]
def inplT(n): return [tuple(input()) for _ in range(n)]
def inpll(n): return [list(map(int, input().split())) for _ in range(n)]
def inplls(n): return sorted([list(map(int, input().split())) for _ in range(n)])

def main():
    n,k = inpm()
    ans = [1 for _ in range(n)]
    for _ in range(k):
        d = inp()
        a = inpl()
        for i in range(d):
            ans[a[i]-1] = 0
    print(sum(ans))    
if __name__ == "__main__":
    main()

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

Solution (Python):
N_K =input('').split(' ')
lst = []
N = int(N_K[0])
K= int(N_K[1])
for n in range(0,N+1):
    lst.append(0)
for i in range(0, K ):
    D = int(input(''))
    A = map(int, input('').split(' '))
    for d in A:
        lst[d] = 1

ans = 0
for j in lst:
    if j == 0:
        ans = ans+1
print(ans-1)

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


for i in range(K):
  di = int(input())
  arr= list(map(int,input().split()))
  for j in arr:
    if(j in n):
      n.remove(j)

print(len(n))

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

d = [0] * K
A = []
cnt = [0] * N
ans = 0


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

for i in range(K):
    for j in range(len(A[i])):
        cnt[A[i][j]-1] += 1

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

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

kind = set()

for i in range(k):
    d = input()
    list_a = list(map(int,input().split()))
    s_a = set(list_a)
    kind = kind | s_a

print(n-len(kind))

Solution (Python):
import sys

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

k = list(range(N))

for _ in range(K):
    d = map(int, sys.stdin.readline().split())
    A = map(int, sys.stdin.readline().split())
    for a in A:
        k[a-1] = ''

print(len([i for i in k if i != '']))

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


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

Set=set([])

for i in range(K):
    Set=Set|set(S[2*i+1])

print(N-len(Set))

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

Solution (Python):
n,k=map(int,input('').split(' '))
a=[]
d=[]
for i in range(k):
    s=int(input(''))
    d.append(s)

    s=input('')
    s=s.split(' ')
    for j in range(len(s)):
        s[j]=int(s[j])
    a.append(s)

b=[]
for i in range(n):
    b.append(0)

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

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

print(m)

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


for shop in range(K):
    members = int(input())
    holder = input().split( )
    i=0
    for i in holder:
        list[int(i)-1] = 1
print(list.count(0))

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

a = []

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

ans = n - len(a)

print(ans)

Solution (Python):
b1=input().split()
N=int(b1[0])
K=int(b1[1])

L=[0 for n in range(N)]
for k in range(K):
  n1=int(input())
  n2=input().split()
  for x in range(n1):
    L[int(n2[x])-1]+=1

A=0
for z in L:
  if z==0:
    A+=1

print(A)

Solution (Python):
[N, K] = list(map(int, input().split()))
dList = []
AList = []
snuckSnack = {}
for i in range(K):
    dList.append(int(input()))
    AList.append(list(map(int, input().split())))
for i in range(1,N+1):
    snuckSnack[i] = set()
for i in range(K):
    for j in AList[i]:
        snuckSnack[j].add(dList[i])
vicCount = 0
for i in range(1,N+1):
    if snuckSnack[i] == set():
        vicCount += 1
print(vicCount)

Solution (Python):
n, k = map(int,input().split())
data = []
for _ in range(k):
    d = int(input())
    data.extend(list(map(int,input().split())))

print(n-len(set(data)))

Solution (Python):
import itertools
n, k = map(int, input().split())
d = []
a = []
n_1=[i for i in range(1,n+1)]
for i in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
a_1 = list(itertools.chain.from_iterable(a))
c=list(set(n_1)-set(a_1))
print(len(c))

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

print(n - len(set(t)))

Solution (Python):
n, k = list(map(int, input().split()))
person = [True for _ in range(n)]
for _ in range(k):
    d = int(input())
    sweet = list(map(int, input().split()))
    for p in sweet:
        person[p-1] = False

print(len(list(filter(lambda x:x, person))))

Solution (Python):
n, k = map(int, input().split())
s = {i for i in range(1,n+1)}
for i in range(k):
    d = int(input())
    a = set(map(int, input().split()))
    s = s - a

print(len(s))

Solution (Python):
import collections
N, K = map(int, input().split())
M = [list(map(int, input().split())) for i in range(K * 2)]
snuke_snack = []
for i in range(K):
    snuke_snack.extend(M[2 * i + 1])
count = collections.Counter(snuke_snack)
print(N - len(count))

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

p = set(range(1, N+1))

for _ in range(K):
    okashi = input()
    k = map(int, input().split(" "))
    for x in  k:
        p.discard(x)
print(len(p))

Solution (Python):
n,k=[int(_) for _ in input().split()]
d=[]
a=[]
h=[0 for _ in range(n)]
for i in range(k):
    d.append(int(input()))
    a.append([int(_) for _ in input().split()])
for i in range(k):
    for j in range(d[i]):
        h[a[i][j]-1]+=1
print(h.count(0))

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

Solution (Python):
n,k = map(int,input().split())
ALL=[]
for i in range(k):
    d=int(input())
    A = list(map(int,input().split()))
    for ii in range(d):
        ALL.append(A[ii])
ans=list(set(list(range(1,n+1))) - set(ALL))
print(len(ans))

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

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

sumans = [0] * 110

i = 1
while i <= k:
  d = int(input())
  j = 0
  aes = list(map(int, input().split()))
  while j < d:
    sumans[aes[j]] = 1
    j += 1
  i += 1

ans = n - sum(sumans)
print(ans)

Solution (Python):
N,K = map(int,input().split())
A = [0]*N
for _ in range(K):
  d = input()
  List = list(map(int,input().split()))
  for item in List:
    A[item-1] += 1 
counter = 0
for item in A:
  if item == 0:
    counter += 1
print(counter)

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

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

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

    for a in as_:
        try:
            s.remove(a)
        except ValueError:
            pass
print(len(s))

Solution (Python):

import numpy as np

n, k = map(int, input().split())
d = np.zeros((k))
a = np.zeros(())
list_all = []
set_all = {}
for i in range(k):
    d = input()
    list_all.extend(input().split())
    set_all = set(list_all)

ans = n - len(set_all)

print(ans)

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

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

print(sum(snks))

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

res = list(range(1,n+1))
s = set({})
for i in range(k):
    okashi = int(input())
    okashi_hito = set(map(int, input().split()))
    s = s.union(okashi_hito)
print(n - len(s))

Solution (Python):
N,K = map(int,input().split())
A = [[0 for j in range(K)]for i in range(K)]
B = [0 for j in range(N)]
S = 0
for i in range(K):
    d = int(input())
    A[i] = list(map(int,input().split()))
for i in range(K):
    for j in range(len(A[i])):
        for k in range(N):
            if A[i][j] == k+1:
                B[k] = 1
for i in range(N):
    if B[i] != 1:
        S += 1
print (S)

Solution (Python):
N, K = map(int, input().split())
N_set = {i+1 for i in range(N)}
for i in range(K):
  d = int(input())
  A = list(map(int, input().split()))
  for j in range(d):
    N_set.discard(A[j])
print(len(N_set))

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

Solution (Python):
import numpy as np

N,K = [int(i) for i in input().split(" ")]
ans = np.zeros(N)
for i in range(K):
    d = int(input())
    ar = [int(i) for i in input().split(" ")]
    for l in range(d):
        ans[ar[l]-1] += 1

print(np.count_nonzero(ans == 0))

Solution (Python):
n,k = map(int,input().split())
t = []
for i in range(k):
    d = int(input())
    li = list(map(int,input().split()))
    for k in range(len(li)):
        t.append(li[k])

c=0
for i in range(1,n+1):
    if(i not in t):
        c += 1
print(c)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, K = map(int, readline().split())
    d = []
    A = []
    for _ in range(K):
        d.append(int(readline()))
        A.append(readline().decode().split())
    ans = 0
    for n in range(1,N+1):
        cnt = 0
        for i in range(len(A)):
            cnt += A[i].count(str(n))
        if cnt == 0:
            ans += 1
    print(ans)
    return

if __name__ == '__main__':
    main()

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

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

num = 0

lst = []

for i in range(K):
    d = int(input())
    a = input().split()
    lst.extend(a)



for i in range(1,N+1):
    if not str(i) in lst:
        num += 1

print(num)

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

names = list(range(1,n+1))
for i in range(0,k):
  j = i*2
  syoji = sunukes[j]
  okashi = sunukes[j+1]
  for n in okashi:
    if n in names:
      names.remove(n)

print(len(names))

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

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

res = [1]*(n+1)
res[0] = 0

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

print(sum(res))

Solution (Python):
N, K = map(int, input().split())
d_list = []
A_list = []
for i in range(K):
    d_list.append(int(input()))
    A_ = list(map(int, input().split()))
    A_list.extend(A_)

K_all = set(A_list)
N_all = set(range(1, N+1))

no_N = N_all - K_all

print(len(no_N))

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


okashi = [0] * n


for i in a:
    for j in i:
        okashi[j-1] = 1

ans = n - sum(okashi)

print(ans)

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

d = []
grid = []
Hu = [0]*N
for i in range(K):
  d.append(int(input()))
  array = list(map(int, input().strip().split()))
  grid.append(array)



for i in range(K):
  X = grid[i]
  for i in range(N):
    if (i+1) in X:
      Hu[i] = Hu[i] + 1
      

print(Hu.count(0))

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

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

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

print(A.count(0))

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

ans = [0] * n

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

    
    for x in a:
        ans[x-1] = 1



print(ans.count(0))

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

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

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

ans = []

for i in range(k):
  d = int(input())
  aa = list(map(int,input().split()))
  ans.extend(aa)

import collections

c = collections.Counter(ans)

print(n - len(c.keys()))

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

Solution (Python):

N,K = map(int, input().split())
D =[]
A =[]
for _ in range(K):
    d = int(input())
    a =list(map(int, input().split()))

    D.append(d)
    A.append(a)


for i in range(1,K):
    A[0].extend(A[i])


print(N-len(set(A[0])))

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

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