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())
set_a = []

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

set_a = set(set_a)
print(n - len(set_a))

Solution (Python):
N, K = map(int, input().split())
lst = []
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for char in A:
        if char not in lst:
            lst.append(char)
count = 0
for i in range(1, N+1):
    if i not in lst:
        count += 1
print(count)

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

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

print(c.count(0))

Solution (Python):
N, K = map(int, input().split())
A = set()
for i in range(K):
    _ = input()
    for j in input().split():
        A.add(int(j))
print(N-len(A))

Solution (Python):
def main():
    n, k = map(int, input().split())
    sunuke = set()
    for _ in range(k):
        input()
        sunuke |= set(map(int, input().split()))
    print(len(set(range(1, n+1))-sunuke))

if __name__ == "__main__":
    main()

Solution (Python):


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

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

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

answer=[0]*(N+5)
for k in range(K):
    D=int(input())
    A=list(map(int,input().split()))
    for a in A:
        answer[a]=1

for a in answer:
    N-=a
print(N)

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

memo = []
for i in range(k):
  d = int(input())
  a = [int(num) for num in input().split()]
  for j in a:
    memo.append(j)
  
memo = set(memo)
print(n-len(memo))

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

for i in range(k*2):
  a = list(map(int, input().split()))
  if i % 2 == 1:
    for j in range(len(a)):
      okashi[a[j]-1] = 1
      
print(okashi.count(0))

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

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

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

print(N - len(a))

Solution (Python):
N,K = map(int, input().split())
a = set()
for i in range(K*2):
  b= set(map(int,input().split()))
  if i % 2 == 0:
    continue
  a|= b
print(N - len(a))

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

for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    for j in a:
        if j in n:
            n.remove(j)
    
print(len(n))

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

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

sunuke = [0] * (n)

for i in a:
    for j in i:
        
        sunuke[j-1] += 1


ans = 0
for i in sunuke:
    if i == 0:
        ans += 1
print(ans)

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

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

s = [0] * N

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

    for num in A:
        s[num-1] += 1
print(s.count(0))

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

D=[0]*N

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


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

print(cnt)

Solution (Python):
sunuke,var = map(int,input().split())
loser = [1] * sunuke
for i in range(var):
  d = int(input())
  tmp = map(int,input().split())
  for t in tmp:
    loser[t-1] = 0
print(sum(loser))

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

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

print(v.count(0))

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

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

sunuke = [0] * n

for candy in a:
    for i in candy:
        i -= 1
        sunuke[i] += 1

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

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

Solution (Python):
N, K = map(int, input().split())
l1 = [0]*N
for _ in range(K):
    d = int(input()) 
    l2= list(map(int, input().split()))
    for val in l2:
        l1[val-1] = 1
print(N-sum(l1))

Solution (Python):
import math

def main():
    a, b = map(int, input().split())
    array = []
    for _ in range(b):
        c = int(input())
        d = list(map(int, input().split()))
        array = array + d


    print(a - len(set(array)))





if __name__ == "__main__":
    main()

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

Solution (Python):
I=lambda:map(int,input().split())
N,K=I()
r=[1]*N
for _ in [0]*K:
  I()
  for a in I():r[a-1]=0
print(sum(r))

Solution (Python):




def main():
    n, k = map(int, input().split())
    a = []
    for i in range(k):
        d = int(input())
        ai = list(map(int, input().split()))
        a = a + ai
 
    print(n-len(set(a)))
    return

if __name__ == '__main__':
    main()

Solution (Python):


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

print(n-len(set(l)))

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

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

print(n-len(set(a)))

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

print(n-len(set(a)))

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

for j in range(k):
    d=int(input())
    l=map(int,input().split())
    for x in l:
        if lst[x-1]:lst[x-1]=False 
print(lst.count(True))

Solution (Python):
import math  
from typing import Dict, List, Optional, Set, Tuple, Union  


def main(N: int, K: int, D: List[int], A: List[List[int]]) -> None:
    ans: Set[int] = {i for i in range(1, N + 1)}
    for a in A:
        for a_ in a:
            ans -= {a_}
    print(len(ans))


if __name__ == "__main__":
    N, K = map(int, input().split())
    D = []
    A = []
    for _ in range(K):
        d = int(input())
        D.append(d)
        a = list(map(int, input().split()))
        A.append(a)
    main(N, K, D, A)

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

result = [0 for i in range(N)]

for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for di in range(d):
        result[A[di] -1] = 1
        
print(N - sum(result))

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

Solution (Python):
def main():

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

    ans = 0
    for i in range(1, N+1):
        if i not in have:
            ans += 1
    return ans


if __name__ == '__main__':
    print(main())

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

a = [input() for i in range(2 * k)]
b = a[1:2*k:2]
y=[]
for i in b:
  x = i.split()
  y.extend(x)

b=[]
d=1
while d <= 100:
  b.append(str(d))
  d+=1

c = 0

for i in b:
  if i in y:
    c += 1

c = n - c
print(c)

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

di = []
snax = []
  
for i in range(0, k):
  temp = []
  di.append(int(input()))
  temp = list(map(int, input().split()))
  for i in temp: snax.append(i)

count = 0
  
for i in arr2:
  if not(i in snax): count+= 1
    
print(count)

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

print(n - len(set(A)))

Solution (Python):
n, k = map(int, input().split())
kouho = set(range(1, n + 1))

for kashi in range(1, k + 1):
  a = input()
  lst = map(int, input().split())
  for b in lst:
    kouho.discard(b)
print(len(kouho))

Solution (Python):
n,k=map(int, input().split())
nl=list(range(1,n+1))
dl=[]
al=[]
for i in range(k):
  d=int(input())
  dl.append(d)
  a = list(input().split())
  a = [int(i) for i in a]
  al.append(a)
  
for i in range(k):
  if len(nl) == 0:
    print(0)
    exit()
  for ii in al[i]:
    if ii in nl:
      nl.remove(ii)
print(len(nl))

Solution (Python):
n, k = map(int, input().split())
a = [x*0 for x in range(n)]
count = 0

for i in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        a[A[j]-1] += 1
    
for t in range(n):
    if a[t] == 0:
        count += 1

print(count)

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

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

print(n - len(set(c)))

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

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

Solution (Python):
N,K=[int(i) for i in input().split()]
sunuke=[0]*N
for k in range(K):
    dk=int(input())
    A=[int(i) for i in input().split()]
    for a in A:
        sunuke[a-1]+=1
    
n=sum([a==0 for a in sunuke])
print(n)

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

Solution (Python):
N,K=map(int,input().split())
T=[]
count=0
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for j in range(d):
        if A[j] not in T:
            T.append(A[j])
for k in range(N):
    if k+1 not in T:
        count+=1
print(count)

Solution (Python):
n, k = map(int, input().split())
A = [input() for _ in range(2*k)]
num = []
list1 = []

for i in range(1, 2*k, 2):
  num = A[i].split()
  list1 += num

print(n - len(set(list(list1))))

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

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

Solution (Python):
def main():
  n, k = map(int, input().split())
  
  kids = list()
  sum = 0
  
  for i in range(k):
    dustbox = input()
    kids += list(map(int, input().split()))
    
  for i in range(1, n+1):
    if i not in kids:
      sum += 1
      
  print(sum)
  
main()

Solution (Python):
n, k = map(int, input().split())
kids = list()
for i in range(k):
    d = input()
    kids += list(map(int, input().split()))
res = 0
for i in range(1,n+1):
    if i not in kids:
        res+= 1
print(res)

Solution (Python):

N,K = map(int,input().split())
lis = [1]+[0]*N
for _ in range(K):
    d = int(input())
    A = map(int,input().split())
    for x in A:
        lis[x] += 1
print(len([x for x in lis if x==0]))

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


A=list(itertools.chain.from_iterable(A))

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

print(count)

Solution (Python):
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int 
float 


for name in fruits: 
    print(name)


list0 = [] 
list0 = [1,2,3,4] 
list0 = [0]*10 
list1= [i for i in range(10)] 
list1 = list(map(int, input().split()))　
number=[int(input()) for i in range(int(input()))] 
list1 = list1 + [6, 7, 8] 
list2.append(34) 
list.insert(3,10) 
len(list4) 
max(sa) 
list5.count(2) 
list1.sort() 
list1.sort(reverse=True)  
set(list1) 
sum([2,3,   ,3]) 

abs(a) 
max(a,b) min(a,b) 
text1 = text1.replace("34","test") 

exit(0) 

cumsum(リスト) 
cumsum_number(N,K,x) 
"""
N,K=map(int,input().split())
number=[1]*N
for i in range(K):
    A=int(input())
    number1=map(int,input().split())
    for j in number1:
        number[j-1]=0
print(number.count(1))

Solution (Python):
n,k=map(int,input().split())
d=[]
a=set()
for i in range(k):
    nu=int(input())
    d.append(nu)
    m=set(map(int,input().split()))
    a |=m
    
b=set()
for i in range(1,n+1):
    b |= {i}

count=0
for v1 in b:
    if not v1 in a:
        count+=1
print(count)

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

Solution (Python):
def main():
  
  

  
  

  
  
  
  if 'get_ipython' in globals(): 
    
    n, k = 3, 2
    D = [2, 1]
    A = [[1, 3], [3]]

  else:
    
    
    n, k = map(int, input().split())
    D = [0]*k
    A = []
    for i in range(k):
      D[i] = int(input())
      A.append(list(map(int, input().split())))

  
  cnt = 0
  ans = []
  for a in A:
    for i in a:
      if i not in ans:
        ans.append(i)
  print(n-len(ans))
  
main()

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

result = {}

for i in range(K):
    
    input()
    for d in input().split(' '):
        result[d] = True

print(N - len(result))

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

Z=set()

for i in range(K):
  s=int(input())
  c=input()
  c_list=c.split()
  for r in c_list:
    Z.add(r)
  
print(N-len(Z))

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

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

for i in range(1,k+1):
    d = int(input())
    a=set(map(int,input().split()))
    A += a

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

print(len(ans))

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

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

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

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

print(len(ans))

Solution (Python):
from collections import Counter
N, K = map(int, input().split())
xd=[]
for i in range(K):
    d = int(input())
    x = list(map(int, input().split()))
    xd.extend(x)

xd= Counter(xd)

print(N-len(xd))

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

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

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

print(n-sum(ans))

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

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

A_set=list(set(A_list))

n=N-len(A_set)
print(n)

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())))
ans = [1] * n
for i in range(k):
  for j in range(d[i]):
    if ans[a[i][j]-1] == 1:
      ans[a[i][j]-1] = 0

print(sum(ans))

Solution (Python):
import numpy as np
n,k = map(int,input().split())
sunuke_number = [0]*n
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(len(a)):
        sunuke_number[a[j]-1] = 1
print(sunuke_number.count(0))

Solution (Python):
n,k = map(int,input().split())
ans = [0]*n
for i in range(k):
    d = int(input())
    a = list(map(int,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())
count = [0]*n
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(len(a)):
        count[a[j]-1] += 1

print(count.count(0))

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

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

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

Solution (Python):
N, K = map(int, input().split())
sunuke = set([x for x in range(1,N+1)])
for k in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    sunuke.difference_update(A)
    
print(len(sunuke))

Solution (Python):
N, K = map(int, input().rstrip().split())
sunuke = [int(i) for i in range(1,N + 1)]
d = []
A = []

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

for k in range(K):
  for i in range(d[k]):
    if A[k][i] in sunuke:
      sunuke.remove(A[k][i])
  
    
print(len(sunuke))

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

for i in range(K):
    di = int(input())
    
    Ai = [j-1 for j in map(int, input().split())]
    for j in Ai:
        l[j] = False





print(l.count(True))

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

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

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

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

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

print(have.count(False))

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

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

a_set = set(a)

a_set = list(a_set)

print(n - len(a_set))

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

a_set=set(a)
a_set=list(a_set)
print(n-len(a_set))

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

count=[0]*(n)

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

Solution (Python):
import numpy as np

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

trick = np.ones(N, dtype=bool)

for _ in range(K):
    _ = input()
    Index = list(map(lambda x: int(x)-1, input().split(" ")))
    trick[Index] = False

print(np.sum(trick))

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

for i in range(k):
    d=int(input())
    l+=map(int,input().split())
    
x=set(l)
x=list(x)
print(n-len(x))

Solution (Python):
def resolve():
	N, K = map(int, input().split())
	a = []*K
	for i in range(K*2): 
		if i%2 == 0:
			_ = input()
		else:
			a.extend(list(map(int, input().split())))
	print(N - len(set(a)))

resolve()

Solution (Python):

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

cnt = [0] * n

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

print(cnt.count(0))

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

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

print(li.count(0))

Solution (Python):
n,k=map(int,input().split(' '))
s=set([i+1 for i in range(n)])

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

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

for _ in range(K):
    input()
    S -= set(map(int, input().split(' ')))

print(len(S))

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

check = []

for k in range(K):
    for i in range(d[k]):
        if A[k][i] not in check:
            check.append(A[k][i])

count = 0

for n in range(N):
    if n+1 not in check:
        count += 1
        
print(count)

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

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

print(ans)

Solution (Python):
n, k = map(int, input().split())
sunuke = list(range(1, n+1))
d = []

for i in range(k):
    d.append(int(input()))
    a_temp = (list(map(int, input().split())))
    for t in a_temp:
        if t in sunuke:
            sunuke.remove(t)

print(len(sunuke))

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

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

Solution (Python):
N , K = map(int,input().split())
sunukes = [1 for _ in range(N)]
for _ in range(K):
  d = input()
  owner_list = [int(i) for i in input().split()]
  for owner in owner_list:
    sunukes[owner-1] = 0
print(sum(sunukes))

Solution (Python):
import sys 
from collections import deque
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())
def LS(): return list(sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def Main():
    n,k = IL()
    s = [0]*n
    d = deque()
    for __ in range(k):
        d = I()
        tmp = deque(LI())
        for _ in range(d):
            s[tmp.pop()-1] += 1
    print(s.count(0))
    return

if __name__=='__main__':
    Main()

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

ANS = []
for i in range(k):
  ANS = ANS + DA[2*i+1]

print(n - len(list(set(ANS))))

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

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

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

for i in range(0,K):
    d = input()
    a = list(map(int, input().split()))
    s_list.append(a)

num = len(set(sum(s_list,[])))
print(N-num)

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

Solution (Python):
import sys
def rs(): return sys.stdin.readline().rstrip()
def ri(): return int(rs())
def rs_(): return [_ for _ in rs().split()]
def ri_(): return [int(_) for _ in rs().split()]

N, K = ri_()
a = [1] * N
for _ in range(K):
    d = ri()
    A = ri_()
    for i in A:
        a[i - 1] = 0
print(sum(a))

Solution (Python):
n,k=map(int,input().split())
kli=[i+1 for i in range(k)]
L=[]
for i in range(k):
    x=int(input())
    li=list(map(int,input().split()))
    for j in li:
        L.append(j)
L=set(L)
print(n-len(L))

Solution (Python):
[N,K]=list(map(int, input().split()))
dlist=[]
alist=[]
for i in range(K):
    d=int(input())
    dlist.append(d)
    alist.append(list(map(int, input().split())))
nlist=[n for n in range(1,N+1)]
ans=0
for n in range(1,N+1):
    flg=True
    for als in alist:
        if n in als:
            flg=False
            break
    if flg:
        ans+=1
print(ans)

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

Solution (Python):
def trick_or_treat():
    condition = input()
    c_list = condition.split()
    N = int(c_list[0])
    K = int(c_list[1])
    get_list = []
    for k in range(0, K):
        d = int(input())
        A_str = input()
        A_list_s = A_str.split()
        
        for i in A_list_s:
            
            get_list.append(int(i))
    
    get_list.sort()
    sunuke_list = []
    for i in range(1, N+1):
        sunuke_list.append(i)
    
    get_list = list(set(get_list))
    num = len(sunuke_list) - len(get_list)
    print(num)
    return      

trick_or_treat()

Solution (Python):
N,K = map(int,input().split())
d = []
A = []
count = [0]*N
count.insert(0,'X')

for i in range(K):
	d.append(input())
	A.append(list(map(int,input().split())))
	
for s in range(len(A)):
	for t in range(len(A[s])):
		count[A[s][t]] += 1

print(count.count(0))

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

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

Solution (Python):
N, K = map(int, input().split())
li = [0 for i in range(N)]
for i in range(K):
  d  = int(input())
  li1 = list(map(int, input().split()))
  for j in li1:
    li[j-1] = 1
print(N-sum(li))

Solution (Python):
import numpy as np
def resolve():
    N,K = map(int,input().split())
    ans = np.ones(N,dtype=int)
    for i in range(K):
        d = int(input())
        A = input().split()
        for j in range(d):
            ans[int(A[j]) - 1] = 0
    print(sum(ans))
resolve()

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

ans = n
p = []

for i in range(k):
    for j in a[i]:
        if not j in p:
            p.append(j)
            ans -= 1

print(ans)

Solution (Python):
n, k = list(map(int, input().split()))
flags = [False] * n
count = 0

for i in range(k):
  d = int(input())
  people = list(map(int, input().split()))
  for p in people:
    flags[p - 1] = True
for flag in flags:
  if not flag:
    count += 1
print(count)

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

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

for _ in range(K):
  d = int(input())
  for i in input().split():
    S.discard(int(i))

print(len(S))

Solution (Python):
N, K = map(int, input().split())
sweet = [0 for i in range(N)]
for i in range(K):
  s = input()
  for j in map(int, input().split()):
    sweet[j-1] = 1
cnt = 0
for k in sweet:
  if k == 0:
    cnt += 1
print(cnt)

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

aset = list(set(a))

result = 0
for i in range(1,n+1):
    if i in aset:
        continue
    else:
        result += 1

print(result)

Solution (Python):
import sys

def solve():
    input = sys.stdin.readline
    N, K = map(int, input().split())
    S = [0] * N
    for _ in range(K):
        d = int(input())
        A = [int(a) for a in input().split()]
        for a in A: S[a-1] += 1
    print(S.count(0))

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):
N, K = map(int, input().split())
m = {x: False for x in range(1, N + 1)}
for _ in range(K):
    _ = input()
    for x in input().split():
        m[int(x)] = True

print(sum([1 for x in m.values() if x == False]))

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

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

def main():
    N, K = map(int, input().split())
    have = [False] * N
    ans = N
    for k in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for a in A:
            if not have[a-1]:
                ans -= 1
            have[a-1] = True
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n, k = map(int, input().split())
A = set()
B = set(i for i in range(1, n+1))
for i in range(k):
    d = int(input())
    A = A | set(map(int, input().split()))
print(len(B - A))