Problem:
 Score : 200 points    Problem Statement N  Snukes called Snuke 1 , Snuke 2 , ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1 , Snack 2 , ..., Snack K . The following d_i Snukes have Snack i : Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}} .  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq K \leq 100  1 \leq d_i \leq N  1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N         Input Input is given from Standard Input in the following format:  N  K  d_1  A_{1, 1} \cdots A_{1, d_1}  \vdots  d_K  A_{K, 1} \cdots A_{K, d_K}       Output Print the answer.        Sample Input 1 3 2
2
1 3
1
3      Sample Output 1 1   Snuke 1 has Snack 1 .  Snuke 2 has no snacks.  Snuke 3 has Snack 1 and 2 .   Thus, there will be one victim: Snuke 2 .       Sample Input 2 3 3
1
3
1
3
1
3      Sample Output 2 2

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

for _ in range(k):
    d = int(input())
    A = list(map(int,input().split()))
    for i in A:
        if i in l:
            l.remove(i)

print (len(l))

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

Solution (Python):
import math
n, k = map(int, input().split())
result = []
for i in range(k):
    okashi = int(input())
    hito = list(map(int, input().split()))
    for j in range(len(hito)):
        if (hito[j] not in result):
            result.append(hito[j])

print(n - len(result))

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

Solution (Python):
n, k = list(map(int, input().split(" ")))
t = [0 for i in range(n)]
for i in range(k):
    _ = input()
    for idx in map(int, input().split(" ")):
        t[idx - 1] += 1
print(len(list(filter(lambda x: x == 0, t))))

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

c = ['1']*n

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

d = c.count('1')

print(d)

Solution (Python):
n, k = map(int,input().split())
arr = [i for i in range(1,n+1)]
for i in range(k):
   _ = input()
   tmp = list(map(int,input().split()))
   for j in tmp:
      if j in arr:
         arr.remove(j)
print(len(arr))

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

Solution (Python):
"""
>>> main(3, 2, [[2, [1, 3]], [1, [3]]])
1
"""


def main(n: int, k: int, d_a: list):
    snuke = [[] for _ in range(n)]

    for d, a in d_a:
        for _a in a:
            snuke[_a - 1].append(d)

    ans = 0
    for s in snuke:
        if len(s) == 0:
            ans += 1

    print(ans)


if __name__ == "__main__":
    n, k = map(int, input().split())

    d_a = [[int(input()), list(map(int, input().split()))] for _ in range(k)]

    main(n, k, d_a)

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

li = [0]*N

for i in range(K):
    d=int(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())
c = [0] * n

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

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

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

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

print(sum(tmp))

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

Solution (Python):
import numpy as np
N, K = map(int, input().split())

have = np.ones(N)
for i in range(K):
    d = int(input())
    snack = np.array(list(map(int, input().split())))
    have[snack-1] = 0


print(int(sum(have)))

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())))
    
s = [0 for _ in range(n)]

for i in range(k):
    for j in range(d[i]):
        s[a[i][j] - 1] += 1
        
print(s.count(0))

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

arr = [0 for i in range(n+1)]
arr[0] = 1

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

ans = arr.count(0)
print(ans)

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

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

for i in range(k):
    d = int(input())
    a = input().split(" ")
    for num in a:
        li[int(num) - 1] = 1

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

print(cnt)

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

all_set = set(list(range(1, n+1)))
food_set = set()
for _ in range(k):
    t = input()
    lst = list(map(int, input().split()))
    for num in lst:
        food_set.add(num)
print(len(all_set - food_set))

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

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

Solution (Python):
n, k = map(int, input().split())
sn = [i for i in range(1, n+1)]
sn = set(sn)
l = []
for i in range(k):
    d = int(input())
    mini_l = list(map(int, input().split()))
    l.extend(mini_l)

l = set(l)
ans = len(sn - l)
print(ans)

Solution (Python):

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

Solution (Python):
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
import itertools
import math
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
start = time.time()
N, K = map(int, input().split(' '))
sunuke = []
for i in range(K):
    d = input()
    sunuke.extend(input().split(' '))


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

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

A = [False]*(N+1)
for i in range(K):
    dk = int(input())
    ad = list(map(int,input().split()))
    for a in ad:
        A[a] = True

count = 0
for a in A[1:]:
    if not a:
       count += 1 

print(count)

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

s = set([i+1 for i in range(N)])

for i in range(K):
  d = int(input())
  s = s - set(map(int,input().split()))

print(len(s))

Solution (Python):
date0=input().rstrip().split(" ")
N=int(date0[0])
K=int(date0[1])
list0=[]
for i in range(N):
    list0.append(0)
for j in range(K):
    d=int(input())
    date=input().rstrip().split(" ")
    k=0
    for k in range(d):
        list0[int(date[k])-1]=1
print(list0.count(0))

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

a = set(sum(a, []))
cnt = 0
for i in range(n):
    if i+1 not in a:
        cnt += 1

print(cnt)

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

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

A = set()

for i in range(K):
    d = int(input())
    B = [int(x) for x in input().split()]
    A = A | set(B)

print(N - len(A))

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

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

print(n-len(b))

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

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

for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        if sunuke[a-1] != 0:
            sunuke[a-1] = 0

ans = 0
for i in sunuke:
    if i != 0:
        ans += 1

print(ans)

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

a=[]
b=[0]*K
d=[0]*K

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

  
dic = {}

for i in a:
  for j in i:
    dic[j] = 1


print(N-len(dic))

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

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

c = collections.Counter(A)

print(N-len(c))

Solution (Python):
n, k = map(int, input().split())
people = set()
for _ in range(k):
    _ = input()
    people = people | {int(i) for i in input().split()}

print(n - len(people))

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

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

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

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

print(people.count(0))

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

for i in range(K):
	for j in A[i]:
		test[j-1] =1
print(N-sum(test))

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

X=[0]*N

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

print( X.count(0) )

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

Solution (Python):
n, k = map(int, input().split())
by_sweets = {}
for _ in range(k):
    d = int(input())
    a_list = list(map(int, input().split()))
    for a in a_list:
        by_sweets.setdefault(a, 0)
        by_sweets[a] += 1


print(n - len(by_sweets))

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

g = [1 for _ in range(n)]
for ai in a:
  for aii in ai:
    aii -= 1
    g[aii] = 0
print(sum(g))

Solution (Python):
def main():
    N, K= map(int, input().split())
    Sunuke = set()
    for i in range(K):
        d = input()
        Sunuke = Sunuke | set(map(int, input().split()))

    print(N - len(Sunuke))

if __name__ == "__main__":
    main()
    pass

Solution (Python):

N, K = map(int, input().split())
B = {i:0 for i in range(N)}

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

answer = 0
for j in B.values():
    if j == 0:
        answer += 1

print(answer)

Solution (Python):
k = list(map(int, input().split()))
listA=[]
while True:
    try:
        listA.append(list(map(int,input().split())))
    except:
        break;
l = []
m = 0
for i in listA:
  if m % 2 == 1:
    l.append(i)
  m += 1
flat = sum(l, [])
import collections
c = collections.Counter(flat)

print(k[0] - len(c))

Solution (Python):


def solve():
    hm = {}
    for i in a:
        if not str(i) in hm:
            hm[str(i)] = 1
    print(n - len(hm))
    return



n, k = [int(s) for s in input().split(" ")]
d = []
a = []
for i in range(k):
    d.append(int(input()))
    a.extend([int(s) for s in input().split(" ")])
solve()

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

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

sunuke = [0]*N
for i in range(K):
  d = int(input())
  tmp = list(map(int,input().split()))
  for j in range(d):
    sunuke[tmp[j]-1] = 1
print(sunuke.count(0))

Solution (Python):
'''
.append(要素) リストに要素を追加
.extend(リスト) リストを連結する
.insert(場所,要素) 指定した場所に要素追加
del 配列名[場所]
-1で末尾で末尾から一つ前

sort()
sorted(reverse=true)

配列の初期化
配列名=[a]*n+[b]*m

Decimal()
'''

from sys import stdin
from itertools import accumulate, dropwhile, takewhile, groupby
import bisect
import copy
import math
from functools import reduce
from operator import mul
from collections import Counter
import itertools
import fractions

t = stdin.readline().rstrip().split()
n = int(t[0])
k = int(t[1])
res = []
for el in range(k):
    tt = int(stdin.readline().rstrip())
    person = [int(s) for s in stdin.readline().rstrip().split()]
    for el3 in person:
        res.append(el3)
count = 0
for el in range(1, n + 1):
    if not (el in res):
        count += 1
print(count)

Solution (Python):
N,K = map(int,input().split())
A = [list(map(int,input().split())) for i in range(K*2)]
A_ = [A[i] for i in range(len(A)) if i%2 == 1]

sunuke = [0]*N

for i in range(K):
    kasi = A_[i]
    for j in range(len(kasi)):
        s = kasi[j]-1
        if sunuke[s] == 0:
            sunuke[s] = 1
print(N-sum(sunuke))

Solution (Python):

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

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

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

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

d = {}

for i in range(m):
    input()
    L = list(map(int,input().split()))
    
    for j in L:
        d[j] = j


print(n - len(d))

Solution (Python):
from sets import Set

N, K = map(int, raw_input().split())
snukes = Set()
for k in range(K):
	raw_input()
	snukes.update(Set(map(int, raw_input().split())))
print N - len(snukes)

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

flat_list = [s for a in A for s in a]
set_a = set(flat_list)
ans = 0

for i in range(1, N + 1):
    if not i in set_a:
        ans += 1

print(ans)

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush, nlargest, nsmallest
from math import ceil, floor, gcd, fabs, factorial, fmod, sqrt, inf, log
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction



mod = pow(10, 9) + 7
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(" ".join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


n, k = sp()
graph = dd(set)
for i in range(k):
    d = int(data())
    arr = l()
    for j in arr:
        graph[j].add(i+1)
answer = 0
for i in range(1, n+1):
    if len(graph[i]) == 0:
        answer += 1
out(answer)

Solution (Python):
N,K=map(int,input().split())
ln=[]
for i in range(K):
    d=int(input())
    A=list(map(int,input().split()))
    for a in A:
        if a in ln:
            pass
        else:
            ln.append(a)
print(N-len(ln))

Solution (Python):
N, K = map(int, input().split())
A_list = []
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    A.append(d)
    A_list.append(A)
dic_S = {}
for i in range(K):
    for j in range(len(A_list[i])-1):
        if A_list[i][j] in dic_S:
            dic_S[A_list[i][j]] += 1
        else:
            dic_S[A_list[i][j]] = 1
ans = 0
for i in range(1, N+1):
    if i not in dic_S:
        ans += 1
print(ans)

Solution (Python):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,K = FLI()
d = [0]*K
m = []
for i in range(K):
    d[i] = I()
    for j in FLI():
        m.append(j)
print(N-len(set(m)))

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

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):
        ans[A[j]-1] = 0
        
print(sum(ans))

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

Solution (Python):
N,K = map(int,input().split())
data = [1]*N
for k in range(K):
    input()
    num = list(map(int,input().split()))
    for i in num[:]:
        data[i-1] = 0
print(sum(data))

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

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

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

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

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

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

li=[0]*n
for i in range(k):
        d=int(input())
        lis = list(map(int,input().split()))
        for j in range(len(lis)):
                li[lis[j]-1]+=1
        lis.clear
cnt=0
for i in range(len(li)):
        if li[i]==0:
                cnt+=1

print(cnt)

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

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

Solution (Python):
from sys import stdin


def main():
    input = lambda: stdin.readline()[:-1]
    N, K = map(int, input().split())
    snk = [0] * (N + 1)
    for _ in [0] * K:
        D = int(input())
        A = map(int, input().split())

        for a in A:
            snk[a] += 1
    print(snk[1:].count(0))


main()

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

kid = [0] * (N + 1)

num = 0

for i in range(1, K + 1):
  d = int(input())
  sweet = input().split()
  for j in range(d):
    kid[int(sweet[j])] += 1
    
for s in range(1, N + 1):
  if kid[s] == 0:
    num += 1

print(num)

Solution (Python):
n , k = map(int, input().split())
nusukes = list(range(1, n+1))
for _ in range(k) :
    d = int(input())
    lst = list(map(int, input().split()))
    for i in lst :
        if i in nusukes :
            nusukes.remove(i)
print(len(nusukes))

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

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 k in A:
        cnt[k-1] += 1
ans = 0
for i in cnt:
    if i == 0:
        ans += 1
print(ans)

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

sunu = [0]*n

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

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

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

Solution (Python):
import numpy as np

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

arr = np.zeros((K, N))

for i in range(K):
    d = input()
    lists = list(map(int, input().split()))
    for j in lists:
        arr[i, j-1] = 1
arr = np.sum(arr, axis=0)
count = 0
for i in arr:
    if i == 0:
        count+=1
print(count)

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

for _ in range(k):
    d.append(int(input()))
    a_i = map(int,input().split())
    a.extend(a_i)

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

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

for _ in range(K):
    d = int(input())
    As = input().split()
    tmp = []
    for i in As:
        
        A.add(i)




print(N-len(A))

Solution (Python):
N, K = list(map(int, input().split()))
snack = []
for i in range(K):
    number = int(input())
    s = list(map(int, input().split()))
    for j in range(len(s)):
        snack.append(s[j])

answer = 0
for i in range(1, N+1):
    if i not in snack:
        answer += 1

print(answer)

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

s = set()
for aa in A:
    for a in aa:
        s.add(a)
print(N - len(s))

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

boy = [0]*N

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


print(boy.count(0))

Solution (Python):

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

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

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


for i in range(k):
    d = int(input())
    nums = map(int, input().split())
    for j in nums:
        l[j-1] = 0
print(l.count(1))

Solution (Python):



                            
                            
                            
                            



import sys
import math as mt


def get_ints(): return map(int, sys.stdin.readline().strip().split())
def get_array(): return list(map(int, sys.stdin.readline().strip().split()))

def printwsp(*args): return print(*args, end="")
def printsp(*args): return print(*args, end=" ")
def printchk(*args): return print(*args, end="tst, ")

MOD = int(1e9+7); BABYMOD = 998244353;



n, k = get_ints()
count = [False]*n
for i in range(k):
    d = int(input())
    li = get_array()
    for i in li:
        count[i-1] = True
ans = 0
for i in count:
    if i is False:
        ans += 1
print(ans)


'''
THE LOGIC AND APPROACH WAS DEVELOPED BY ME @luctivud.
SOME PARTS OF THE CODE HAS BEEN TAKEN FROM WEBSITES LIKE::
(I Own the code if no link is provided here or I may have missed mentioning it)
PLEASE DO NOT PLAGIARISE.
'''

Solution (Python):

import sys
input = sys.stdin.readline

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

dp = [0] * n

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

    for j in people:
        dp[j-1] += 1


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

print(ans)

Solution (Python):
from sys import stdin


def get_result(data):
    N, K = data[0]
    A = data[1:]
    sunuke = set()
    for A_val in A[1::2]:
        for val in A_val:
            sunuke.add(val)

    return N - len(sunuke)


if __name__ == '__main__':
    raw_data = [val.rstrip() for val in stdin.readlines()]
    data = [list(map(int, val.split(' '))) for val in raw_data]
    result = get_result(data)
    print(result)

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

for k in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for di in range(d):
        L[A[di]-1] += 1

total = 0
for n in range(N):
    if L[n] == 0:
        total += 1

print(total)

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

Solution (Python):
if __name__ == "__main__":
    N, K = list(map(int, input().split()))
    sunuke = set()
    for i in range(K):
        d = int(input())
        seq = list(map(int, input().split()))
        for a in seq:
            sunuke.add(a)

    print(N-len(list(sunuke)))

Solution (Python):
nk = input().split()
n = int(nk[0])
k = int(nk[1])

su = [0] * n
d = []


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

cnt = 0


for i in su:
	if int(i) == 0:
		cnt += 1

print(cnt)

Solution (Python):
N, K = map(int, input().split())
flg = [False] * N
for _ in range(K):
    d = int(input())
    A = [int(a) for a in input().split()]
    for a in A:
        flg[a-1] = True
cnt = 0
for f in flg:
    if not f:
        cnt += 1
print(cnt)

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

ls =[]
for i in range(1,K*2,2):
    ls = ls + A[i]
print(N - len(set(ls)))

Solution (Python):
def I(): return int(input())
def LI(): return list(map(int,input().split()))
N,K = LI()
dA = [[LI() for _ in range(2)] for _ in range(K)]
num = set()
for x in dA:
    d,A = x
    for y in A:
        num.add(y)
print(N-len(num))

Solution (Python):
line = input().split(" ")
n = int(line[1])
sunuke_num = int(line[0])

okasi_has_list = []

for i in range(n):
  okasi_num = int(input())
  okasi_list = input().split(" ")
  okasi_has_list = okasi_has_list + okasi_list

output = set(okasi_has_list)

print(sunuke_num - len(output))

Solution (Python):
N,K = list(map(int,input().split()))
matrix = [[0 for _ in range(K)] for _ in range(N)]
box = [input() for _ in range(2*K)]

for i in range(int(len(box)/2)):
    j = 2*i+1
    candy = list(map(int,box[j].split()))
    for k in candy:
        matrix[k-1][i] = 1

count = 0
for line in matrix:
    if sum(line) == 0:
        count += 1
print(count)

Solution (Python):
import itertools

N, K = map(int, input().split())
d_list = []
A_list = []
for _ in range(K):
    d_list.append([int(input())])
    A_list.append([int(i) for i in input().split()])

p_set = set([j for j in range(1, N+1)])

A_set = set(list(itertools.chain.from_iterable(A_list)))

print(len(list(p_set-A_set)))

Solution (Python):
if __name__ == "__main__":
  n,k = map(int, input().split())
  ll = []
  for i in range(k):
    d = int(input())
    ll.append(list(map(int, input().split())))

  ans = set()
  for item in ll:
    ans = ans | set(item)

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

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

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

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

print(a)

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

sunuke = [0 for i in range(N+1)]

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

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

print(count)

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

Solution (Python):
import sys

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

    sunuke = []
    for _ in range(K):
        _ = input()
        next_sunuke = list(map(int, input().split()))
        for i in next_sunuke:
            sunuke.append(i)
    sunuke = set(sunuke)

    print(N - len(sunuke))

    return

if __name__ == '__main__':
    main()
    sys.exit(0)

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())))
import itertools
b = list(set(list(itertools.chain.from_iterable(a))))
cnt = 0
for i in range(1,n+1):
    if not i in b:
        cnt+=1
print(cnt)

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

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

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

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

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

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

for j in range(1, N+1):
    if j not in A:
        ans += 1

print(ans)

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

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

Solution (Python):
def main():
    n, k = [int(x) for x in input().split()]
    all_ = set(x for x in range(n))
    snack_holders = set()
    for i in range(k):
        int(input())
        for x in input().split():
            snack_holders.add(int(x) - 1)

    return len(all_ - snack_holders)


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

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

arr = []
for i in range(N):
    arr.append(0)

for i in range(K):
    _ = input()
    a = list(map(int, input().split()))
    for j in a:
        arr[j - 1] += 1

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