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 math
import collections

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

    for k in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for a in A:
            ans[a] = 1
    print(N - len(ans))

    return 0

if __name__ == '__main__':
    main()

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

Solution (Python):



def solve(n, k, info):
    all_set = set(range(1, n + 1))
    sub_set = set()
    for _, bs in info:
        sub_set.update(bs)
    rest_set = all_set - sub_set
    return len(rest_set)


def main():
    n, k = (int(z) for z in input().split())
    info = []
    for _ in range(k):
        d = int(input())
        bs = [int(z) for z in input().split()]
        info.append((d, bs))
    print(solve(n, k, info))


if __name__ == "__main__":
    main()

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

s = set()
for i in range(NK[1]):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(d):
        s.add(A[j])

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

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

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

Solution (Python):



def main():
    N, K = map(int, input().split())
    d = [None] * K
    A = [None] * K

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


print(main())

Solution (Python):


import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))

def resolve():
    N,K=pin()
    a=[0]*N
    for k in range(K):
        d=int(input())
        A=list(pin())
        
        for n in range(d):
            a[A[n]-1]+=1
    cnt=0
    for aa in a:
        if aa==0:cnt+=1
    print(cnt)

resolve()

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

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

count = []
for i in range(k):
    for j in range(len(a[i])):
        count.append(a[i][j])

count = set(count)

print(n-len(count))

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

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

s = set()
for i in range(K):
    for a in A[i]:
        s.add(a)


print(N - len(s))

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

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

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

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

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

ans = 0
for j in range(n):
    if tmp[j] == 0:
        ans += 1

print(ans)

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 a:
        have[j-1]=True
print(have.count(False))

Solution (Python):

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

lis = [True] * N

for i in range(K):

    d = int(input())

    A = list(map(int,input().split()))

    for j in A:
        lis[j-1] = False

ans = 0
for i in range(N):

    if lis[i]:
        ans += 1
print (ans)

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

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

have_sunuke = []

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

print(len(list(set(all_sunuke)-set(have_sunuke))))

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

for i in range(k):
    n=input()
    q=list(map(int,input().split()))
    for j in q:
        d[j]+=1
ans=0
for i in d.values():
    if i==0:
        ans+=1
print(ans)

Solution (Python):
n, k = map(int, input().split())
table = [False for i in range(n)]
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for v in a:
        table[v-1] = True
ans = n - sum(table)
print(ans)

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

a = [0] * n

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

    for j in range(len(t)):
        a[t[j]-1] = 1


print(a.count(0))

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

print(sum(sunuke))

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

for _ in range(k):
    input()
    A = list(map(int, input().split()))
    for a in A:
        L[a - 1] = False
print(sum(L))

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

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

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

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

ans = 0
for i,v in hashMap.items():
  if v == 0:
    ans += 1
print(ans)

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

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

ans = []
for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    ans = list(set(ans) | set(a))

print(N - len(list(ans)))

Solution (Python):
from sys import stdin


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

tr = [0] * n
for i in range(k):
    d =int(stdin.readline().rstrip())
    As = list(map(int, stdin.readline().rstrip().split()))
    for a in As:
        tr[a-1] = 1

print(tr.count(0))

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

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

ans = 0
for i in d:
    if d[i] == []:
        ans += 1

print(ans)

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

Solution (Python):
def m():
    n, k = map(int, input().split())
    dic = {}
    for _ in range(k):
        d = int(input())
        a = list(map(int, input().split()))
        for i in a:
            dic[i] = 1
    return n - len(dic.keys())


print(m())

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

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

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

for _ in range(k):
    d = int(input())
    b = [int(x) for x in input().split()]

    for x in b:
        a[x] = 0

print(sum(a))

Solution (Python):

n,k = [int(j) for j in input().split()]
dif = [False for i in range(n)]
for i in range(k):
	d = input()
	l = [int(j) for j in input().split()]
	for j in l:
		dif[j-1] = True
print(dif.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())))
  
sunuke = [0] * N
for i in range(K):
  for j in range(len(A[i])):
  	sunuke[A[i][j]-1] += 1

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

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


lst = [False] * N

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

    for y in x:
        if lst[y - 1]:
            continue
        else:
            lst[y - 1] = True



cnt = 0
for a in lst:
    if not a:
        cnt += 1

print(cnt)

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

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

l = [0]*n

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

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

Solution (Python):
n , k = map(int,input().split())
p = {i+1 for i in range(n)}
kar = set()
for j in range(k):
    d = int(input())
    a = set(list(map(int,input().split())))
    kar = kar | a

p = p - kar

print(len(p))

Solution (Python):
import sys
sys.setrecursionlimit(1000000000)
import math
from math import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations, chain
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp



class UnionFindEx:
    def __init__(self, size):
        
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    
        self.roots[r2] = r1
        return True

Yes = 'Yes'
No = 'No'


def main():
    N,K=mis()
    s = set()
    for _ in range(K):
        input()
        s |= set(lmis())
    print(N-len(s))

main()

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)  
to_index = lambda x: int(x) - 1  
print_list_in_2D = lambda x: print(*x, sep="\n")  


def input_int():
    return int(input())

def map_int_input():
    return map(int, input())

MII = map_int_input

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

def MII_to_index():
    return map(to_index, input())

def MII_split_to_index():
    return map(to_index, input().split())


def list_int_inputs():
    return list(map(int, input()))

LII = list_int_inputs

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


def LII_2D(rows_number):
    return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number):
    return [LII_split() for _ in range(rows_number)]

N, K = MII_split()
sunukes = [0 for _ in range(N)]  
for k in range(K):
    _ = input()
    As = MII_split()
    for A in As:
        sunukes[A - 1] += 1

print(sunukes.count(0))

Solution (Python):
import numpy as np
N,K = map(int,input().split())
L = np.zeros(N+1)
for _ in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for i in A:
        L[i] += 1

print(len(L[L==0])-1)

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

print(n-len(set(s)))

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

print(n - sum(has))

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

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

print(n-len(ans))

Solution (Python):
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, K = list(map(int,_in[0].split(' ')))  
    d_arr = []
    for i in range(K):
        _ = int(_in[2*i+1])  
        d_arr.append(_)
    A_arr = []
    for i in range(K):
        _ = list(map(int,_in[2*i+2].split(' ')))  
        A_arr.append(_)
    
    _ = list(set(sum(A_arr,[])))
    cnt = N-len(_)
    
    print(cnt)

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

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

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

Solution (Python):
n, k = map(int,input().split())
d = []
a = []
for _ in range(k):
    d.append(int(input()))
    a.append(list(map(int,input().split())))
check = [False] * n
for i in range(k):
    for j in a[i]:
        check[j-1] = True

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

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

Solution (Python):
import itertools
import math
import numpy as np
import fractions
from collections import deque
from itertools import combinations
from functools import reduce
from functools import lru_cache
import bisect
import sys
import math
sys.setrecursionlimit(10**9)

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

    kashi = []
    for i in range(K):
        d = int(input())
        A = list(input().split())
        for a in A:
            if not a in kashi:
                kashi.append(a)


    print(N-len(kashi))


if __name__ == "__main__":
  main()

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

have = [0] * (N + 1)
have[0] = 1
for _ in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        have[a] = 1
print(have.count(0))

Solution (Python):
n,k=map(int,input().split())
ans=set()
for _ in range(k):
    _=int(input())
    l=set([int(i) for i in input().split()])
    ans |= l
print(n-len(ans))

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

print(n-len(aset))

Solution (Python):




def main():
    N, K = list(map(int, input().split()))
    A = []
    for _ in range(K):
        _ = input()
        A.append(list(map(int, input().split())))
    B = set()
    for a in A:
        for aa in a:
            B.add(aa)
    print(N - len(B))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

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

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

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

nums = [0] * N

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

ans = 0
for num in nums:
    if num == 0:
        ans += 1
print(ans)

Solution (Python):
N, K = map(int, input().split())
s = set()
for _ in range(K):
    D = int(input())
    s.update(map(int, input().split()))
print(N - len(s))

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

for _ in range(m):
    d = int(input())
    data = list(map(int, input().split()))
    for d in data:
        count[d-1] += 1

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

Solution (Python):
N, K = map(int, input().split())
S = set()
for _ in range(K):
    d = int(input())
    S |= set(input().split())
print(N-len(S))

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

Solution (Python):

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

if __name__ == '__main__':
    resolve()

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

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

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

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

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


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


print(ans)

Solution (Python):
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

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

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 j in a:
        l[j-1] += 1
ans = 0
for i in l:
    if i == 0:
        ans +=1
print(ans)

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

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

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

Solution (Python):






import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr


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





N,K = inputIL()

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

for k in range(K):
  n = input()
  l_ = inputIL()
  for item in l_:
    l[item-1] += 1
ans = 0
for item in l:
  if item == 0:
    ans += 1
    
print(ans)

Solution (Python):


iim = lambda: map(int, input().rstrip().split())

def resolve():
    N, K = iim()

    okasi = set()
    for i in range(K):
        input()
        for i in iim():
            okasi.add(i)

    print(N-len(okasi))

if __name__ == "__main__":
    resolve()

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

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

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

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

have_candy = [False] * n
for i in range(k):
    d = int(input())
    x = list(map(int, input().split()))
    for i in x:
        have_candy[i-1] = True

print(n - sum(have_candy))

Solution (Python):
def main():
    n, k = map(int, input().split())
    ans_list = []
    for i in range(k):
        d = int(input())
        num_list = list(map(int, input().split()))
        for j in range(d):
            ans_list.append(num_list[j])

    ans_list = list(set(ans_list))

    print(n - len(ans_list))

if __name__ == '__main__':
    main()

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


snk = [False]*n

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

print(snk.count(False))

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

sunu = [1 for i in range(n)]
for i in range(k):
    for a in a_list[i]:
        sunu[a-1] = 0
print(sum(sunu))

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

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

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

Solution (Python):
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N, K = lr()
    c = [1]*N
    for i in range(K):
        d = ir()
        A = lr()
        for j in range(d):
            c[A[j]-1] = 0
    print(sum(c))
resolve()

Solution (Python):
n,k = map(int,input().split())
ans = [0]*n
for _ in range(k):
    n=int(input())
    t = list(map(int,input().split()))
    for i in t:
        ans[i-1] = 1
memo = 0

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

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

s = set()
for i in range(k):
  d =input()
  s |= set(list(input().split()))
  
  
print(n-len(s))

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