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(' '))
sn = [0] * n
for i in range(k):
    d = int(input())
    o = list(map(int, input().split(' ')))
    for j in o:
        sn[j - 1] += 1
print(sn.count(0))

Solution (Python):
import numpy
N, K = map(int, input().split())
d = 0
l = list(numpy.zeros(N))

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

print(l.count(0))

Solution (Python):

import sys, re
from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from heapq import heappush, heappop, heapify, nlargest, nsmallest
def STR(): return list(input())
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def list2d(a, b, c): return [[c] * b for i in range(a)]
def sortListWithIndex(listOfTuples, idx):   return (sorted(listOfTuples, key=lambda x: x[idx]))
def sortDictWithVal(passedDic):
    temp = sorted(passedDic.items(), key=lambda kv: (kv[1], kv[0]))
    toret = {}
    for tup in temp:
        toret[tup[0]] = tup[1]
    return toret
def sortDictWithKey(passedDic):
    return dict(OrderedDict(sorted(passedDic.items())))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
ans = 0
n, k = MAP()
dd = defaultdict(int)
for i in range(k):
    d = INT()
    temp = LIST()
    for el in temp:
        dd[el] = 100
for i in range(n):
    if(dd[i+1]==0):
        ans+=1
print(ans)

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

x = [0] * n
for a in A:
    for i in a:
        x[i-1] += 1

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

Solution (Python):
N,K = list(map(int,input().split()))
N_S = [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):
        if a[j] in N_S:
            N_S.remove(a[j])
print(len(N_S))

Solution (Python):
import itertools

n,k = map(int, input().split())
d = []
A = []
for i in range(k):
    d.append(int(input()))
    A.append(map(int, input().split()))
B = list(itertools.chain.from_iterable(A))

ans=0
for i in range(n):
    if i+1 not in B:
        ans+=1
print(ans)

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 i in range(len(a)):
        c[a[i]-1]+=1

print(c.count(0))

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

sunuke_list=[1]

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

for i in range(K):
    num=int(input())
    have_list=input().split(" ")
    for j in range(num):
        tmp=int(have_list[j])
        sunuke_list[tmp]=1

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

Solution (Python):
N,K = map(int, input().split())
data = [list(map(int, input().split())) for _ in range(2*K)]
menber = [i for i in range(1,N+1)]
l = []
set0 = set(l)
for i in range(K):
    set1 = set(data[2*i+1])
    set0 = set0.union(set1)
print(N-len(set0))

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 k in range(d):
        ans[A[k]-1] += 1
print(ans.count(0))

Solution (Python):
N,K=map(int,input().split())
ans=[]
a=0
for i in range(K):
    a=input()
    ans.append(input().split())
def flatten_2d(data):
    for block in data:
        for elem in block:
            yield elem
d = list(flatten_2d(ans))

anse=set(d)
print(N-len(anse))

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


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

a = list(itertools.chain.from_iterable(a))
a = list(set(a))

print(n - len(a))

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

count = 0
for i in range(N):
    flag = 1
    for j in range(K):
        if i+1 in A[j]:
            flag = 0
    if flag == 1:
        count += 1

print(count)

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

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

Solution (Python):
N, K = map(int, input().split())
withSnacks = []
for x in range(K):
	nUmsnakes = int(input())
	snakes = list(map(int, input().split()))
	withSnacks.extend(snakes)
withSnacks = list(set(withSnacks))
count = 0
for x in range(1, N + 1):
	if not x in withSnacks:
		count += 1
 
print(count)

Solution (Python):
import numpy as np


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

l = []
s = set()

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

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

Solution (Python):
n,k = map(int,input().split())
li1 = [0]*n
li2 = []
for i in range(n):
    li1[i] += i+1
for i in range(k):
    S = input()
    li2 += input().split()
li3 = [int(s) for s in li2]
diff = set(li1) ^ set(li3)
print(len(diff))

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

Solution (Python):
N,K=map(int,input().split())
ls=[False for _ in range(N)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for j in range(d):
    ls[A[j]-1]=True
S=0
for i in range(N):
  if ls[i]==False:
    S+=1
print(S)

Solution (Python):
n, trick = map(int, input().split())
nusuke = [0]*n
for _ in range(trick):
  d = int(input())
  a = map(int, input().split())
  for t in a:
    nusuke[t-1] += 1

print(nusuke.count(0))

Solution (Python):
from pprint import pprint

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

d = []
a = []

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






checkedlist = [0] * n
counter = 0

for i in range(k):
    for j in range(d[i]):
        if checkedlist[a[i][j] - 1] == 0:
            checkedlist[a[i][j] - 1] = 1
            counter += 1
        else:
            pass

print(n - counter)

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

for i in range(k):
    input()
    for j in map(int, input().split()):
        have_treats.add(j)
    
print(n - len(have_treats))

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

print(ans.count(0))

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

snuke = list(set(snuke))
snacks = list(set(snacks))
print(n - len(snacks))

Solution (Python):
params0 = list(map(lambda x: int(x), input().split(' ')))
paramN, paramK = params0

data = [True for i in range(paramN)]

for i in range(paramK):
    input()
    sunukes = list(map(lambda x: int(x), input().split(' ')))
    for sunuke in sunukes:
        data[sunuke - 1] = False

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

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

d = []
A = []
ans = []

check = list(range(N))

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())
l=[0]*n
ans=n
for i in range(k):
    o=int(input())
    for ih in list(map(int,input().split())):
        if l[ih-1]==0:ans-=1;l[ih-1]=1
print(ans)

Solution (Python):
import numpy as np
n, k = list(map(lambda x: int(x), input().split(' ')))
su = list(range(1, n+1))
for i in range(int(k)):
  input()
  tmp = list(map(lambda x: int(x), input().split(' ')))
  for j in tmp:
    if j in su:
      su.remove(j)
  

print(len(su))

Solution (Python):
N,K = map(int,input().split())
sunuke_dict = {}
for i in range(K):
    d = int(input())
    sunuke_dict[i] = list(map(int,input().split()))
ans = [1]*(N+1)
ans[0]  =0
for v in sunuke_dict.values():
    for v_ in v:
        if ans[v_] == 1:
            ans[v_] =0
print(sum(ans))

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

print(N-len(C))

Solution (Python):
N, K = map(int, input().split())
d_list=[]
S_list=[]
j_list=[]
for i in range(K):
    d = int(input())
    d_list.append(d)
    S = list(map(int, input().split()))
    S_list.append(S)

    
for j in S_list:
    j_list=j_list+j

j_set=set(j_list)
print(N-len(j_set))

Solution (Python):
N, K = map(int, input().split()) 
sunuke = list(range(1,N+1))

for i in range(K): 
    kasi = int(input()) 
    motteru = map(int, input().split()) 
    for _ in motteru: 
        if _ in sunuke:
            sunuke.remove(_) 
print(len(sunuke))

Solution (Python):

from sys import stderr

def debug(*args):
    print(*args, file=stderr)


def input_sweets_owners():
    input()
    return list(map(int, input().split()))

n_sukuke_num, k_sweets_types_num = map(int, input().split())
ai_sweets_owners = [input_sweets_owners() for _ in range(k_sweets_types_num)]






sunuke_n_has = {}

for i, sweets_owners in enumerate(ai_sweets_owners):
    for sweets_owner in sweets_owners:
        sunuke_n_has[sweets_owner] = True



result = 0
for sunuke_i in range(1, n_sukuke_num+1):
    
    if not sunuke_i in sunuke_n_has:
        result += 1

print(result)

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

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

s = 0
for i in d:
  if i == 0:
    s += 1

print(s)

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

list = []

for a in A:
    for num in a:
        if num in list:
            continue
        list.append(num)

ans = N - len(list)

print(ans)

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

Solution (Python):
inputLine = input()
tempStr = inputLine.split(' ')

numPeople = int(tempStr[0])
numCandy = int(tempStr[1])

candyList = [0] * numPeople
for index in range(numCandy) :

		inputLine = input()
		inputLine = input()
		tempStr = inputLine.split(' ')

		for eachPeople in tempStr :
			candyList[int(eachPeople) - 1] += 1

finalAns = 0
for eachCandy in candyList :
	finalAns = finalAns + 1 if eachCandy == 0 else finalAns

print(finalAns)

Solution (Python):
line1=input("")
li1=line1.split()
numOfSnuke=eval(li1[0])
numOfSnack=eval(li1[1])
list=[];
num=0
count=1
for i in range(numOfSnuke):
  list.append(0)

while(count<=numOfSnack):
  snack = eval(input(""))
  line=input("")
  li=line.split()
  for item in li:
    list[eval(item)-1]+=1
  count+=1
for i in list:
  if i==0:
    num+=1
print(num)

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

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

print(pos.count(False))

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

tricked = [0] * n
for i in range(k):
    for j in range(d[i]):
        tricked[a[i][j]-1] = 1

print(n-sum(tricked))

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

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

for k_ in range(K):
  n = int(input())
  a = list(map(int,input().split()))
  nn |= set(a)
  
print(len(all-nn))

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())))
have_sweet = set(sum(A, []))
all_member = set([i for i in range(1, N+1)])
print(len(have_sweet ^ all_member))

Solution (Python):

if __name__ == "__main__":
    N,K = list(map(int,input().split()))
    d = []
    A = [0] * N
    for i in range(K):
        tmpd = (int(input()))
        tmpa = (list(map(int,input().split())))
        for j in range(tmpd):
            A[tmpa[j]-1] =+ 1
    emptycnt = 0
    for i in range(N):
        if A[i] == 0:
            emptycnt = emptycnt + 1
    print(emptycnt)

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

A=[0 for _ in range(N)]

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

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

Solution (Python):
NK = [int(x) for x in input().split()]
d=[]
A=[]
x=[]
n=0
for i in range(NK[1]):
  d.append(int(input()))
  A.append([int(x) for x in input().split()])
for i in A:
  for j in i:
    for k in range(NK[0]):
      if j==k+1:
        x.append(j)
        
for i in range(NK[0]):
  if i+1 in x:
    n+=1
print(NK[0]-n)

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

Solution (Python):
N,K = map(int,input().split())
okashi=[0] * N
for i in range(K):
  x=input()
  y=input().split()
  for j in y:
    okashi[int(j)-1]=1
counter=0

for i in okashi:
  if i==0:
    counter=counter+1
print(counter)

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

Solution (Python):
num_list = [int(i) for i in input().split()]
have_list = [list(map(int, input().split())) for i in range(num_list[1]*2)]
user_list = [have_list[i] for i in range(len(have_list)) if i % 2 != 0]

check_set = []
for i in user_list:
    check_set += i
check_set = set(check_set)

ans_num = num_list[0] - len(check_set)
print(ans_num)

Solution (Python):
N, K = [int(n) for n in input().split()]
have_players = set()
for i in range(0, K):
    di = int(input())
    [have_players.add(n) for n in input().split()]
ans = N - len(have_players)
print(ans)

Solution (Python):
s = []
j = 0
num = 0

n,k = map(int, input().split())
for i in range(k):
  d = int(input())
  s.extend(input().split())

s = list(set(s))
for j in range(n):
  p = str(j + 1)
  if p in s:
    num += 1

print(n - num)

Solution (Python):

n,k = map(int,input().split())
dlist = list(range(1,n+1))

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

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

J = []
for i in range(K):
    d = int(input())
    A = [int(g) for g in input().split()]
    J.extend(A)
    i = i + 1
    
j = collections.Counter(J)
ans = N - len(j)

print(ans)

Solution (Python):
people, snack = map(int, input().split())

have_list = [1 for _ in range(people)]

for i in range(snack):
  d = int(input())
  if d == 1:
    person = int(input())
    have_list[person-1] = 0
  else:
    for person in map(int, input().split()):
      have_list[person-1] = 0
      
print(sum(have_list))

Solution (Python):
n, k=map(int, input().split())
l=[]
for i in range(1,k+1):
  dummy=input()
  f=list(input().split())
  l+=f
t=len(set(l))
print(n-t)

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

Solution (Python):
N,K = map(int, input().split())
has = [False for i in range(N)]
for i in range(K):
    input()
    args = list(map(int, input().split()))
    for i in args:
        has[i-1] = True

res = 0
for i in has: 
    if i == False: 
        res += 1
print(res)

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

    haved = [0] * N
    ans = 0
    for i in range(1, K+1, 1):
        d = int(input())
        ai = list(map(int, input().split()))
        for j in range(0, d, 1):
            x = ai[j] - 1
            haved[x] = haved[x] + 1

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import collections

N,K = map(int,input().split())
l = []
for i in range(K):
    d = int(input())
    for a in input().split():
        l.append(a)
print(N - len(collections.Counter(l)))

Solution (Python):


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

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

print(n - len(having_okasi))

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

list_A = [0]*N
ans = 0
d = []
A = []

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

list_A = [0]*N

for i in range(len(A)):
    for j in A[i]:
        list_A[j-1] += 1
        
for i in range(N):
    if list_A[i] == 0:
        ans += 1
        
print(ans)

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

Solution (Python):

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

ans =[]

A = [0]*k
x = [0]*k

for j in range(k):
     x[j]= int(input())
     A[j] = [int(x) for x in input().split()]
     ans += A[j]



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

Solution (Python):
N,K = map(int,input().split())
Ds = []
players = set()
ans = 0
for i in range(K):
    Ds.append(int(input()))
    players |= set(input().split())
for i in range(N):
    if not str(i+1) in players:
        ans+=1
print(ans)

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

Solution (Python):
n,k=[int(x) for x in input().split()]
a=set()
for i in range(k):
    m=int(input())
    arr=[a.add(int(x)) for x in input().split()]
    
print(n-len(a))

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

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

print(len(A))

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

l = [0]*n
for ai in a:
    buf = list(map(int,ai.split()))
    for b in buf:
        l[b-1]=1

total =0 
for ln in l:
    if ln == 0:
        total += 1
        
print(total)

Solution (Python):
N, K = map(int, input().split())
res = {i for i in range(N)}
for _ in range(K):
    d = int(input())
    ll = list(map(int, input().split()))
    for l in ll:
        res -= {l-1}

print(len(res))

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

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

Solution (Python):
from sys import stdin
N, K = map(int, input().split())

data = [list(map(int, stdin.readline().rstrip().split())) for _ in range(N*2)]
sunuke = []
for i in data[1::2]:
  for j in i:
    if not j in sunuke:
      sunuke.append(j)

print( N - len(sunuke))

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

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

k_lst = []
a_lst = []

for _ in range(k):
    k_lst.append(int(input()))
    a_lst.extend(list(map(int,input().split())))

ans = 0

for i in range(n):
    if (i+1) in a_lst:
        continue
    else:
        ans += 1 

print(ans)

Solution (Python):

import collections

[n,k] = list(map(int, input().strip().split()))

counts = collections.Counter()
for i in range(k):
	d = int(input().strip())
	
	arr = list(map(int, input().strip().split()))
	for num in arr:
		counts[num] += 1

ans = 0

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

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

sunuke = [0] * (n+1)

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

print(sunuke.count(0)-1)

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


people = []

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


print(N - len(set(people)))

Solution (Python):

import numpy as np

n, k = map(int, input().split())
f = np.zeros(n)
for i in range(k):
    d = int(input())
    a = map(int, input().split())
    for ai in a:
        f[ai-1] += 1
print(np.count_nonzero(f==0))

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

lis=[]

for i in range(m):
    nb=int(input())
    lis2=list(map(int,input().split()))
    for j in range(nb):
        if lis2[j] not in lis:
            lis.append(lis2[j])


ans=n-len(lis)
print(ans)

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

Solution (Python):


from sys import stdin


def main():
    n, k = map(int, stdin.readline().split())
    d = []
    A = []
    for i in range(k):
        d.append(int(stdin.readline()))
        A.append(list(map(int, stdin.readline().split())))

    okashi = [False] * n
    for a in A:
        for j in a:
            okashi[j - 1] = True
    print(okashi.count(False))
    pass


if __name__ == "__main__":
    main()

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

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

Solution (Python):
import collections

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

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

m = len(list(c.keys()))

print(N-m)

Solution (Python):

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

okashi = [0 for _ in range(n)]

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

print(okashi.count(0))

Solution (Python):
line = input().split(" ")
b = []
for i in range (int(line[1]) * 2):
  if i%2 == 0:
    a = input()
    continue
  a = input().split(" ")
  for j in a:
    b.append(j)
print(int(line[0]) - len(set(b)))

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

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

for i in range(len(A)):
    if not A[i]:
        count += 1

print(count)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n, k = LI()
B = [0] * n
for _ in range(k):
    d = I()
    A = LI()
    for a in A:
        B[a - 1] = 1

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

print(ans)

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

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

itazura = set(A) ^ set(n)

print(len(itazura))

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

a = []

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



a = set(a)

print(len(set(range(1,n+1)) - a))

Solution (Python):
g = set()
lists = list(map(int, input().split())) 
for i in range(lists[1]):
    
    d = int(input())
    a = list(map(int, input().split())) 
    for j in range(d):
        g.add(a[j])

print(lists[0] - len(g))

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

ans = set(sum(a, []))
print(n-len(ans))

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

for i in range(K) :
  d = int(input())
  if d == 1 :
    ans.add(int(input()))
  else :
    A = list(map(int, input().split()))
    for j in A :
      ans.add(j)
      
print(N - len(ans))

Solution (Python):
d=[]
A=[]
Ans=[]

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

for n in range(K):
    d=int(input())
    S= list(map(int,input().split()))
    for s in S:
        A.append(s)

for n1 in range(1,N+1):
    if n1 not in A:
        Ans.append(n1)

print(len(Ans))

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


for i in range(K):
    di = int(input())
    A = [int(x) for x in input().split()]
      

    for a in A:
      if a in d:
      	d.remove(a)
print(len(d))

Solution (Python):
if __name__ == "__main__":
    N, K = map(int, input().split())
    member = set()
    for _ in range(K):
        trash = input()
        member |= set(map(int, input().split()))
    print(N-len(member))

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

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

hogelist = [0] * N

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

count = 0
for i in hogelist: 
    if i == 0:
        count += 1

print(count)

Solution (Python):
import sys
from math import sqrt
from collections import Counter, defaultdict, deque

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 6)


def I():
    return int(input())


def MI():
    return map(int, input().split())


def LI():
    return list(MI())


def LIN(n: int):
    return [I() for _ in range(n)]


inf = float("inf")
mod = 10 ** 9 + 7


def main():
    n, k = MI()

    li = []
    for _ in range(k):
        _ = I()
        li.append(LI())

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

    for l in li:
        for c in l:
            if c in child:
                child.remove(c)

    print(len(child))


if __name__ == "__main__":
    main()

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

print (N-k)

Solution (Python):
import collections as col
N,K = map(int,input().split())
d_i = list()
sunuke_have = list()
for i in range(K):
    d_i = int(input())
    sunuke_have.append(list(map(int,input().split())))

sunuke_f = [0]*(N+1)
for i in range(K):
    for j in range(len(sunuke_have[i])):
        sunuke_f[sunuke_have[i][j]] +=1

print(sunuke_f.count(0)-1)

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

snack_holder = set()
for d, a in da:
    snack_holder |= set(a)

print(n - len(snack_holder))

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


sunuke_tachi = list(range(1, N + 1))
for Ai in A:
    sunuke_tachi = list(set(sunuke_tachi) - set(Ai))

answer = len(sunuke_tachi)

print(answer)

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

Solution (Python):
import collections

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

d = []
a = []

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

c = collections.Counter(a)



ans = 0
for i in range(n):
    if i+1 not in c.keys():
        ans += 1
print(ans)

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

for _ in range(K):
    d = int(input())
    A_list = list(map(int, input().split()))
    AA_list.append(A_list)



ihav_cnt = [0 for _ in range(N) ]


for d, A_list in enumerate(AA_list):
    for a, A in enumerate(A_list):
        ihav_cnt[A-1] = ihav_cnt[A-1]+1


cnt = 0
for ihav in ihav_cnt:
    if ihav == 0:
        cnt = cnt + 1

print(cnt)

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

for num in range(N):
    okashi_map[num+1] = 0

for _ in range(K):
    okashi = input()
    sunuke_list = list(map(int, input().split()))
    for sunuke in sunuke_list:
        okashi_map[sunuke] += 1

find_keys = [k for k, v in okashi_map.items() if v == 0]

print(len(find_keys))