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):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
inf = 10**17
mod = 10**9 + 7


n,k=MI()
A=[0 for i in range(n)]
for i in range(k):
    d=I()
    u=LI()
    for s in u:
        A[s-1]+=1
count=0
for a in A:
    if a==0:
        count+=1
print(count)

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

Solution (Python):
inf = 10**15
mod = 10**9+7
n,k = map(int, input().split())
judge = [1 for i in range(n)]
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for num in a:
        judge[num-1] = 0
print(sum(judge))

Solution (Python):
if __name__ == '__main__':
	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 i in a:
			s[i-1] += 1

	print(s.count(0))

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

Solution (Python):
N, K = map(int, input().split())
s = set()
for _ in range(K):
    _ = input()
    A = set(list(map(int, input().split())))
    
    s = s | A

ans = N - len(s)
print(ans)

Solution (Python):
import sys

n, k = map(int, sys.stdin.readline().split())

def main():
    res = set()
    for _ in range(k):
        d = int(sys.stdin.readline().rstrip())
        *a, = map(int, sys.stdin.readline().split())
        res |= set(a)
    print(n - len(res))

if __name__ == '__main__':
    main()

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

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

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

print(N - len(A))

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

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

Solution (Python):

import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline
from collections import defaultdict
from heapq import heappop, heappush

from decimal import *
































def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007




def main():
	N,K = inputMap()

	ans = [False for i in range(N)]
	for i in range(K):
		d = inputInt()
		A = inputList()
		for jj in A:
			j = jj-1
			if ans[j] == False:
				ans[j] = True

	tmp = 0
	for i in ans:
		if i == False:
			tmp += 1

	print(tmp)











def combination(n, r, mod=10**9+7):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res


def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)

def egcd(a, b):
    if a == 0:
        return b, 0, 1
    else:
        g, y, x = egcd(b % a, a)
        return g, x - (b // a) * y, y



def H(n, r, mod=10**9+7):
	
	
    return combination(n+r-1, r, mod)


class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        
        
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv



def dfs(graph,parent,counter,edge):
    stk = []
    stk.append(edge)
    while len(stk) > 0:
        p = stk.pop()
        for e in graph[p]:
            if parent[p] == e:
                continue
            else:
                parent[e] = p
                counter[e] += counter[p]
                stk.append(e)

if __name__ == "__main__":
	main()

Solution (Python):
import sys
from math import ceil, floor, sqrt, sin, cos, pi
from itertools import accumulate, permutations, combinations
from fractions import gcd 
from collections import deque, Counter
from operator import itemgetter
from heapq import heappop,heappush
sys.setrecursionlimit(10**7)
def lcm(x, y): return ((x * y) // gcd(x, y)) 


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

Solution (Python):
import sys,math,copy,queue,itertools,bisect,collections
from heapq import *
sys.setrecursionlimit(10**7)
LI = lambda : [int(x) for x in sys.stdin.readline().split()]
NI = lambda : int(sys.stdin.readline())
INF = 10**18
MOD = 10**9 + 7
DD = ((1,0),(-1,0),(0,1),(0,-1))

N,K = LI()
s = [0 for _ in range(N+1)]
for _ in range(K):
    d = NI()
    for a in LI():
        s[a] = 1

print(N-sum(s))

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from itertools import accumulate, combinations, permutations, product
from math import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

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

print(ans)

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

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

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

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

n, k = [int(x) for x in input().split()]
flag = [0]*n
for _ in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for i in a:
        flag[i - 1] = 1
ans = 0
for i in flag:
    if not i:
        ans += 1
print(ans)

Solution (Python):


import sys
import math
import collections
import itertools
import bisect
INF = 10 ** 13
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def lcm(x, y) : return (x * y) // math.gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]
def LS() : return input().split()
def RS(N) : return [input() for _ in range(N)]
def LRS(N) : return [input().split() for _ in range(N)]
def PL(L) : print(*L, sep="\n")
def YesNo(B) : print("Yes" if B else "No")
def YESNO(B) : print("YES" if B else "NO")

N, K = LI()
A = [False] * N
for _ in range(K):
    ss = I()
    D = LI()

    for d in D:
        A[d-1] = True

ans = 0
for a in A:
    if not a:
        ans += 1

print(ans)

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


ls = []
N, K = map(int,input().split())
for k in range(K):
    _ = input()
    A = list(map(int,input().split()))
    ls+=A
print (N-len(set(ls)))

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

Solution (Python):
n, k = map(int, input().split())
A = [1]*(n+1)
A[0] = 0
for _ in range(k):
    d = int(input())
    L = map(int, input().split())
    for l in L:
        A[l] = 0
print(sum(A))

Solution (Python):
N, K = map(int, input().split())
se = set()
for _ in range(K):
    d = int(input())
    A = [int(x) for x in input().split()]
    for a in A:
        se.add(a)

print(N - len(se))

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

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

Solution (Python):
pi = 3.1415926


def inp():
    return(int(input().rstrip()))
def inlt():
    return(list(map(int,input().rstrip().split())))
def insr():
    s = input().rstrip()
    return(s[:len(s) - 1])
def invr():
    return(map(int,input().rstrip().split()))

n,k = invr()
ans = [0 for i in range(n)]
cnt = 0
for i in range(k):
    d = inp()
    nums = inlt()
    for j in nums:
        ans[j - 1]= 1

for i in ans:
    if i == 0:
        cnt += 1

print(cnt)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import Counter
def main():
    n,k=map(int,input().split())
    A=[0]*n
    for i in range(k):
        _=int(input())
        a=[int(_) for _ in input().split()]
        for aa in a:
            A[aa-1]+=1
    ac=Counter(A)
    print(ac[0])

if __name__=='__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
A = set()
for i in range(K):
    d = int(input())
    for a in map(int, input().split()):
        A.add(a)

print(N - len(A))

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 i in range(d):
        ans.add(A[i])
    
print(n-len(ans))

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

print(N - len(set(snuke_list)))

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n, k = na()
    sunuke = [0] * n
    for i in range(k):
        d = ni()
        a = na()
        for b in a:
            sunuke[b-1] += 1
    print(sunuke.count(0))

if __name__ == "__main__":
    main()

Solution (Python):
N, K = map(int, input().split())
d = []
A = []
for _ in range(K):
    d_i = int(input())
    a = list(map(int, input().split()))
    d.append(d_i)
    A.extend(a)
set_A = set(A)
ans = N - len(set_A)
print(ans)

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


if __name__ == "__main__":
    main()

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

print(sum([1 for o in okasi if o == 0]))

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

    tricked = [True for _ in range(n)]
    for i in range(k):
        for j in range(d[i]):
            tricked[a[i][j]-1] = False

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

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def main():
    
    
    
    
    

    N, K = get_inputs(int)
    A = set()
    for i in range(K):
        di = get_input(int)
        Ai = get_inputs(int)
        for a in Ai:
            A.add(a)

    print(N - len(A))




if __name__ == '__main__':
    main()

Solution (Python):


from queue import Queue
from queue import LifoQueue as Stack
from math import sqrt, floor, ceil, log2, log10, pi
from fractions import gcd
from itertools import permutations, combinations
from operator import itemgetter
from functools import cmp_to_key


INF=1001001001
__MOD__=(10**9)+7
yn = 'YNeos'
judge = False
cnt = 0
ans = None


def lcm(a, b):
    return (a*b) // gcd(a,b)

def intinput():
    return int(input())

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

def lineinputs(func=intinput):
    datas = []
    while True:
        try:
            datas.append(func())
        except EOFError:
            break
    return datas

class ModInt():
    def __init__(self, x):
        self.__x = (x % __MOD__)
    def __add__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x + other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x + other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __radd__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x + self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x + self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __sub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x - other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x - other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rsub__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x - self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x - self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __mul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rmul__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__x)%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__x)%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __truediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((self.__x * other.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((self.__x * other.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")
    def __rtruediv__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__((other.__x * self.__modinv())%__MOD__))
        elif type(other) == ModInt:
            return self.__class__((other.__x * self.__modinv())%__MOD__)
        else:
            raise Exception("Not Int or Not ModInt")

    def __pow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(self.__x, other.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(self.__x, other.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")
    def __rpow__(self, other):
        if type(other) == int:
            other = self.__class__(other)
            return int(self.__class__(pow(other.__x, self.__x, __MOD__)))
        elif type(other) == ModInt:
            return self.__class__(pow(other.__x, self.__x, __MOD__))
        else:
            raise Exception("Not Int or Not ModInt")

    def __modinv(self, m=__MOD__):
        a = self.__x
        if a == 0:
            raise ZeroDivisionError()
        if gcd(a, m) != 1:
            raise Exception("%sの逆数は求まりません。" % a)
        b, u, v = m, 1, 0
        while b != 0:
            t = a//b;
            a -= t*b
            a, b = b, a
            u -= t * v
            u, v = v, u
        u %= m
        if u < 0:
            u += m
        return u
    def __int__(self):
        return self.__x
    def __str__(self):
        return str(self.__x)



if __name__ == '__main__':
    N, K = mulinputs()
    bucket = [0] * N
    for _ in range(K):
        intinput()
        for m in list(mulinputs()):
            bucket[m-1] += 1


    
    print(len(list(filter(lambda x: x == 0, bucket))))

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

print(sum(target))

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

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

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

    for j in a:
        snuke[j-1] += 1

ans = 0

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

print(ans)

Solution (Python):
n, k = map(int, input().split())
sunuke = [1 for _ in range(n)]
for i in range(k):
    input()
    for a in map(int,input().split()):
        sunuke[a-1]=0
print(sum(sunuke))

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

Solution (Python):


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

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

ans = 0
s_P = list(set(P))
for i in range(1, N+1):
    if i not in s_P: ans+=1
print(ans)

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


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

print(N-len(have))

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

snk_list = []
for i in range(k):
    input()
    b = list(map(int,input().split()))
    snk_list+=b

print(n-len(set(snk_list)))

Solution (Python):
n, k = map(int, input().split())
snuke = set()
for i in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    for Ai in A:
        snuke.add(Ai)

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

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

Solution (Python):
N,K=map(int,input().split())
d=[0 for i in range(K)]
X=[[0 for j in range(N)]for i in range(K)]
for i in range(K):
    d[i]=int(input())
    for j in input().split():
        X[i][int(j)-1]=1
ans=0
for j in range(N):
    flag=1
    for i in range(K):
        if X[i][j]==1:
            flag=0
            break
    if flag:
        ans+=1
print(ans)

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

Solution (Python):
N,K = map(int,input().split())
ans = [False]*N
for _ in [0]*K:
    d = int(input())
    A = map(int,input().split())
    for a in A:
        ans[a-1] = True
print(ans.count(False))

Solution (Python):

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

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

print(N - len(sunukeA))

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

Solution (Python):


n,k=map(int,input().split())
ans=[0 for _ in range(n)]

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

cnt=0
for i in ans:
    if i==0:
        cnt+=1

print(cnt)

Solution (Python):
import sys
import math
import collections
from collections import deque
from functools import reduce
import heapq

n, k = map(int, sys.stdin.readline().split())



c = []
for i in range(k):
    d = int(input())
    a = list(map(int, sys.stdin.readline().split()))
    for j in range(len(a)):
        c.append(a[j])

x = collections.Counter(c)
print(n-len(x))

Solution (Python):
def main():
    N, K = map(int, input().split())
    li = []
    for i in range(K):
        d = int(input())
        s = list(map(int, input().split()))
        li.extend(s)
    print(N - len(set(li)))


if __name__ == "__main__":
    main()

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

print(N- len(set(treat)))

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n, k = na()
a = []

for i in range(k):
    d = ni()
    a.append(na())

l = [0] * n
for i in range(k):
    for j in range(len(a[i])):
        l[a[i][j] - 1] += 1

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

print(ans)

Solution (Python):

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

sunuke = [0 for i in range(1, n+1)]
ans = 0
for i in range(k):
    d = int(input())
    a = [int(i) for i in input().split()]
    for j in a:
        sunuke[j-1] += 1
c = collections.Counter(sunuke)
print(c[0])

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

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

print(ans.count(0))

Solution (Python):
input = raw_input

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

have = [False] * n
for _ in range(k):
    d = int(input())
    As = map(int, input().split(" "))
    for A in As:
        A -= 1
        have[A] = True

out = n - sum(have)    
print(out)

Solution (Python):

n, k = map(int, input().split())
d=[]
su=[0]*n
for _ in range(k):
    d = int(input())
    lis = list(map(int, input().split()))
    for li in lis:
        su[li-1] += 1

print(su.count(0))

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

Solution (Python):
n,m=map(int,input().split())
s=list(range(1,n+1))
for i in range(m):
    p=int(input())
    q=list(map(int,input().split()))
    for j in q:
        if j in s:
            s[s.index(j)]=0
k=0
for i in s:
    if i>0:
        k+=1
print(k)

Solution (Python):
def main():
    N, K = map(int, input().split())
    d = {i:0 for i in range(1, N+1)}
    for i in range(K):
        D = int(input())
        a = list(map(int, input().split()))
        for j in a:
            d[j] += 1
    r = 0
    for i in d:
        if d[i] == 0:
            r += 1
    return r
print(main())

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

Solution (Python):
n, k = map(int, input().split())
d = {}
for i in range(k):
    di = int(input())
    a = list(map(int, input().split()))
    for ai in a:
        d[ai] = 1
print(n - len(d))

Solution (Python):
N,K = map(int,input().split())
chk = [1] * N
for i in range(K):
    n = int(input())
    a = [int(i) for i in input().split()]
    for j in range(len(a)):
        chk[a[j]-1] = 0
print(sum(chk))

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


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

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

Solution (Python):
def mp():return map(int,input().split())
def lmp():return list(map(int,input().split()))

n,k = mp()
okasi = [0]*n
for i in range(k):
    d = int(input())
    a = lmp()
    for j in a:
        okasi[j-1] += 1
print(okasi.count(0))

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

is_appear = [False]*N
for _ in range(K):
    _ = int(input())
    A = list(map(int, input().split()))
    for a in A:
        is_appear[a-1] = True

ans = 0
for b in is_appear:
    if b == False:
        ans += 1

print(ans)

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

Solution (Python):
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N, K = rl()
A = []
for i in range(K):
	d = ri()
	a = rl()
	A.append(a)

cnt = [0] * N
for a in A:
	for i in a:
		cnt[i-1] = 1
ans = 0
for c in cnt:
	if c == 0:
		ans += 1
print(ans)

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

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

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

ans = set()
for i in range(N):
    ans.add(i+1)

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

print(len(ans))

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, K = map(int, readline().split())
ok = [0] * (N + 1)
for _ in range(K):
    d = int(readline())
    A = map(int, readline().split())
    for i in A:
        ok[i] = True

print(N - sum(ok))

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

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