CodeEff/ECCO huggingface dataset:
# Original solution
N, K = list(map(int, input().split()))
sunuke = [0]*N
for _ in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        sunuke[a-1] += 1

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


# Optimized solution
import sys
sys.setrecursionlimit(10 ** 6)


def input():
    return sys.stdin.readline()[:-1]


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

print((A.count(0)))
# Original solution
n, k = list(map(int, input().split()))
A = [None]*k
for i in range(k):
    d = int(eval(input()))
    A[i] = list(map(int, input().split()))

sunuke = [0] * n
for i in range(k):
    for j in A[i]:
        sunuke[j - 1] += 1

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


# Optimized solution
n, k = list(map(int, input().split()))
A = [None]*k
for i in range(k):
    d = int(eval(input()))
    A[i] = list(map(int, input().split()))

snuke = [0] * n
for i in range(k):
    for j in A[i]:
        snuke[j - 1] += 1

ans = 0
for i in snuke:
    if i == 0:
        ans += 1
print(ans)
# Original solution
import sys
input = sys.stdin.readline

def main():
    n, k = list(map(int, input().split()))

    li = []

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

        li += a_li

    print((n - len(set(li))))

if __name__ == '__main__':
    main()


# Optimized solution
n, k = list(map(int, input().split()))

li = []

for i in range(k):
    d = int(eval(input()))
    a_li = list(map(int, input().split()))
    li += a_li

print((n - len(set(li))))
# Original solution
n,k = list(map(int, input().split()))
d = []
a = []
for _ in range(k):
    d1 = int(eval(input()))
    A = list(map(int, input().split()))
    d.append(d1)
    a.append(A)
ans = [0] * n
for s in a:
    for v in s:
        ans[v-1] = 1
print((ans.count(0)))    

# Optimized solution
n,k = list(map(int, input().split()))
d = []
a = []
for _ in range(k):
  D = int(eval(input()))
  A = list(map(int, input().split()))
  d.append(D)
  a += A

a = list(set(a))
check = [1] * n
for i in a:
  check[i-1] = 0
print((sum(check)))
# Original solution
N, K = list(map(int, input().split()))
 
tmp = set()
 
for i in range(K):
  eval(input())
  tmp.update(list(map(int, input().split())))
 
print((N - len(tmp)))

# Optimized solution
N, K = list(map(int, input().split()))
 
tmp = [0] * N
 
for i in range(K):
  eval(input())
  for j in map(int, input().split()):
    tmp[j-1] |= 1 
print((N - sum(tmp)))
# Original solution
N, K = list(map(int, input().split()))
A = [[] for _ in range(N)]
for k in range(K):
    d = int(eval(input()))
    for a in map(int, input().split()):
        A[a - 1].append(k)
print((sum([1 for a in A if len(a) == 0])))


# Optimized solution
N, K = list(map(int, input().split()))
F = [1 for _ in range(N)]
for _ in range(K):
    d = int(eval(input()))
    for a in map(int, input().split()):
        F[a - 1] = 0
print((sum(F)))
# Original solution
n, k = list(map(int, input().split()))
a = set()
for i in range(k):
    d = int(eval(input()))
    a |= set(map(int, input().split()))
print((len(set(range(1, n + 1)) - a)))

# Optimized solution
n, k = list(map(int, input().split()))
a = set()
for i in range(k):
    d = int(eval(input()))
    a |= set(map(int, input().split()))
print((n - len(a)))
# Original solution
# input
N, K = list(map(int, input().split()))

# initialization
p_list = [0]*N

# count
for i in range(K):
    d = int(eval(input()))
    a_nums = list(map(int, input().split()))
    for j in range(d):
        p_list[a_nums[j]-1] += 1

# check
ans = 0
for i in range(N):
    if p_list[i]==0:
        ans += 1

# output
print(ans)


# Optimized solution
# Problem B - Trick or Treat

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

# initialization
snuke = [0]*N
ans = 0

# count
for k in range(K):
    d = int(eval(input()))
    a_nums = list(map(int, input().split()))
    for a in a_nums:
        snuke[a-1] += 1

# check
for s in snuke:
    if s==0:
        ans += 1

# output
print(ans)
# Original solution
N,K = list(map(int, input().split()))
l = []
for i in range(K):
  int(eval(input()))
  temp = input().split()
  l.extend(temp)
print((N-len(set(l))))

# Optimized solution
N,K = list(map(int, input().split()))
l = []
for _ in range(K):
  int(eval(input()))
  l.extend(input().split())
print((N-len(set(l))))
# Original solution
n,k = list(map(int,input().split()))
count = [0]*n
for i in range(k):
    d = int(eval(input()))
    a = list(map(int,input().split()))
    for j in range(len(a)):
        count[a[j]-1] += 1

print((count.count(0)))

# Optimized solution
n,k = list(map(int,input().split()))
ans = [0]*n
for i in range(k):
    d = int(eval(input()))
    a = list(map(int,input().split()))
    for j in range(len(a)):
        ans[a[j]-1] += 1
print((ans.count(0)))
# Original solution
n,k = list(map(int,input().split()))

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

while k > 0:
    d = int(eval(input()))
    a = list(map(int,input().split()))
    for i in range(len(a)):
        if a[i] in sunuke:
            sunuke.remove(a[i])
    k -= 1

print((len(sunuke)))


# Optimized solution
n,k = list(map(int,input().split()))
sunuke = [i for i in range(1,n+1)]
have = []
for i in range(k):
    d = int(eval(input()))
    a = list(map(int,input().split()))
    for i in a:
        have.append(i)

ans = list(set(sunuke) - set(have))
print((len(ans)))
# Original solution
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list([int(x)-1 for x in input().split()])
def II(): return int(eval(input()))
def IF(): return float(eval(input()))
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float("INF")

#solve
def solve():
    n, k = LI()
    ans = [1] * n
    for _ in range(k):
        d = II()
        a = LI_()
        for ai in a:
            ans[ai] = 0
    print((sum(ans)))
    return


#main
if __name__ == '__main__':
    solve()


# Optimized solution
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.buffer.readline().split()]
def I(): return int(sys.stdin.buffer.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
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)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    n,k = LI()
    d = [0]*n
    for _ in range(k):
        LI()
        a = LI()
        for i in a:
            d[i-1] = 1
    print((n-sum(d)))
    return

#Solve
if __name__ == "__main__":
    solve()
# Original solution
def resolve():
	n, k = list(map(int, input().split()))
	p = [0]*n
	for _ in range(k):
		eval(input())
		t = list(map(int, input().split()))
		for i in t:
			p[i-1] += 1
	ans = 0
	for i in p:
		if i == 0:
			ans += 1
	print(ans)
resolve()

# Optimized solution
def resolve():
	n, k = list(map(int, input().split()))
	s = [False]*n
	for i in range(k):
		eval(input())
		for j in list(map(int, input().split())):
			s[j-1] = True
	print((s.count(False)))
resolve()
# Original solution
N,K = list(map(int,input().split()))
snuke = [0]*N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int,input().split()))

    for j in A:
        snuke[j-1] += 1
cnt = 0
for i in snuke:
    if i == 0:
        cnt += 1

print(cnt)

# Optimized solution
N,K = list(map(int,input().split()))

snukes = [1]*N

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

    for i in A:
        snukes[i-1] = 0

print((sum(snukes)))
# Original solution
N, K = list(map(int, input().split()))
d = []
A = []
for i in range(K):
    d.append(int(eval(input())))
    A.append(list(map(int, input().split())))

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


for i in range(N):
    name = hito[i]
    for j in range(K):
        if name in A[j]:
            hito[i] = -1
            break

ans = set(hito)
print((len(ans)-1))


# Optimized solution
N, K = list(map(int, input().split()))
d = []
A = []
for i in range(K):
    d.append(int(eval(input())))
    st = list(map(int, input().split()))
    for j in st:
        A.append(j)

print((N-len(set(A))))
# Original solution
n, k = list(map(int, input().split()))
d_list = []
a_list = []

for i in range(k):
    d_list.append(int(eval(input())))
    a_list.append(list(map(int, input().split())))
nonhave_list = []

for j in range(n):
    for l in range(k):
        exist = False
        if j+1 in a_list[l]:
            exist = True
            break
    if not exist:
        nonhave_list.append(j)

print((len(nonhave_list)))



# Optimized solution
n, k = list(map(int, input().split()))
d_list, a_list = [], []
ans_list = [1] * n

for i in range(k):
    d_list.append(int(eval(input())))
    a_list = list(map(int, input().split()))
    for j in a_list:
        if ans_list[j-1] == 1:
            ans_list[j-1] = 0
print((sum(ans_list)))
# Original solution
n, k = list(map(int, input().split()))
A = [0]*n

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

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

# Optimized solution
n, k = list(map(int, input().split()))
A = [0]*n

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

print((A.count(0)))
# Original solution
N,K=list(map(int,input().split()))
a = [[0]*N]*K
a = [[0 for n in range(N)] for k in range(K)]

for k in range(K):
    d=int(eval(input()))
    have_k=list(map(int,input().split()))
    for h in have_k:
        a[k][h-1]=1

an=[0]*N
for k in range(K):
  for n in range(N):
    an[n] = an[n]+a[k][n]

result=0
for i in an:
  if i == 0:
    result+=1

print(result)

# Optimized solution
N,K=list(map(int,input().split()))
a = [[0 for n in range(N)] for k in range(K)]

for k in range(K):
    d=int(eval(input()))
    have_k=list(map(int,input().split()))
    for h in have_k:
        a[k][h-1]=1

an=[0]*N
for k in range(K):
  for n in range(N):
    an[n] = an[n]+a[k][n]

result=0
for i in an:
  if i == 0:
    result+=1

print(result)
# Original solution
n, k = list(map(int, input().split()))
a = []
for i in range(k):
  d = int(eval(input()))
  a[len(a):len(a)] = list(map(int, input().split()))
list(set(a))
ans = 0
for i in range(1, n+1):
  if i not in a:
    ans += 1
print(ans)

# Optimized solution
n, k = list(map(int, input().split()))
a = []
for i in range(k):
    d = int(eval(input()))
    a.extend(list(map(int, input().split())))
a = list(set(a))
print((n-len(a)))
# Original solution
n, k = list(map(int, input().split()))
A = set([])

for i in range(k):
    d = eval(input())
    A = A | set(map(int, input().split()))

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

# Optimized solution
n, k = list(map(int, input().split()))
A = set([])

for i in range(k):
    d = eval(input())
    A = A | set(map(int, input().split()))

print((n-len(A)))
# Original solution
import sys
input = sys.stdin.readline

n, k = [int(x) for x in input().split()]
flag = [0]*n
for _ in range(k):
    d = int(eval(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)






# Optimized solution
import sys
input = sys.stdin.readline

n, k = [int(x) for x in input().split()]
s = set()
for _ in range(k):
    d = int(eval(input()))
    a = [int(x) for x in input().split()]
    for i in a:
        s.add(i)
ans = 0

for i in range(n):
    if i + 1 not in s:
        ans += 1

print(ans)
# Original solution
# B

inp = input().split(' ')
N, K = int(inp[0]), int(inp[1])

sunuke = [1] * N

for i in range(K):
    di = int(eval(input()))
    tmp = list(map(int, input().split()))
    for t in tmp:
        sunuke[t-1] = 0
print((sum(sunuke)))

# Optimized solution
# B

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

sunuke = [1] * N

for i in range(K):
    di = int(eval(input()))
    tmp = list(map(int, input().split()))
    for t in tmp:
        sunuke[t-1] = 0
print((sum(sunuke)))
# Original solution
N, K = list(map(int, input().split()))
cnt = [0] * N


for _ in range(K):
    _ = int(eval(input()))
    for a in map(int, input().split()):
        cnt[a - 1] += 1
        

print((cnt.count(0)))

# Optimized solution
n,k = list(map(int,input().split()))
cnt = [0]*n

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

print((cnt.count(0)))
# Original solution
N, K = list(map(int, input().split()))
sunuke = [True]*N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        sunuke[a-1] = False

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

# Optimized solution
N, K = list(map(int, input().split()))
flag = [True]*N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for a in A:
        flag[a-1] = False
ans = 0
for i in range(N):
    if flag[i]:
        ans += 1
print(ans)
# Original solution
N,K = list(map(int, input().split()))
a = set()

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

print((N - len(a)))

# Optimized solution
N,K = list(map(int, input().split()))
a = set()
for i in range(K):
  gomi = eval(input())
  b = set(map(int,input().split()))
  a |= b
print((N - len(a)))
# Original solution
n, k =list(map(int, input().split()))
l = [0] * n
for i in range(k):
  d = int(eval(input()))
  lst = list(map(int,input().split()))
  for i in range(d):
    l[lst[i] - 1] += 1
print((l.count(0)))

# Optimized solution
n, k = list(map(int, input().split()))
l = [0] * n
for i in range(k):
    d = int(eval(input()))
    a = list(map(int, input().split()))
    for j in range(len(a)):
        l[a[j] - 1] = 1
print((l.count(0)))
# Original solution
#!/usr/bin/env python3
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools


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


def input_int_list_with_length(length=None):
    if length == None:
        length = int(eval(input()))
    return list(map(int, input().split()))[:length]


def solve(N: int, K: int):
    l = []
    for _ in range(K):
        l += input_int_list_with_length()
    print((N-len(set(l))))


def main():
    solve(*input_int_list())


if __name__ == '__main__':
    main()


# Optimized solution
#!/usr/bin/env python3
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools


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


def input_int_list_with_length(length=None):
    if length == None:
        length = int(eval(input()))
    return list(map(int, input().split()))[:length]


def list_uniq_count(l):
    return len(set(l))


def solve(N: int, K: int):
    l = []
    for _ in range(K):
        l += input_int_list_with_length()
    print((N-list_uniq_count(l)))


def main():
    solve(*input_int_list())


if __name__ == '__main__':
    main()
# Original solution
N,K=list(map(int,input().split()))
hoge=[0 for j in range(N)]
for j in range(K):
    eval(input())
    for i in input().split():
        hoge[int(i)-1]+=1
print((sum([j==0 for j in hoge])))



# Optimized solution
N,K=list(map(int,input().split()))
hoge={}
for j in range(K):
    eval(input())
    [hoge.update({int(j)-1:1}) for j in input().split()]
print((sum([not j in hoge for j in range(N)])))
# Original solution
import itertools
import math
import fractions
import functools

n, k = list(map(int, input().split()))
a = []
for i in range(k):
    di = int(eval(input()))
    ai = list(map(int, input().split()))
    a.append(ai)

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

print((count.count(0)-1))

# Optimized solution
import itertools
import math
import fractions
import functools
n, k = list(map(int, input().split()))
a = []
for i in range(k):
    di = int(eval(input()))
    ai = list(map(int, input().split()))
    a.append(ai)

count=set()

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

print((n-len(count)))
# Original solution
N,K = list(map(int,input().split()))

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

for i in range(K):
    d.append(int(eval(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)

# Optimized solution
N,K = list(map(int,input().split()))
tmp_A = [0]*N
ans = 0

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

con = 0
ans = list(int() for _ in range(100000))
pre = 0


for _ in range(K):

    D = int(eval(input()))
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)

# Optimized solution
N,K=list(map(int,input().split()))

con = 0
ans = list(int() for _ in range(10001))
pre = 0


for _ in range(K):

    D = int(eval(input()))
    arr = list(map(int,input().split()))

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

        
fin = (N+1) - len(set(ans))

print(fin)
# Original solution
def main():
    n,k = tuple([int(t)for t in input().split()])

    t = [0]*n
    for _ in range(k):
        eval(input())
        k = tuple([int(t)-1 for t in input().split()])
        for k_i in k:
            t[k_i]+=1
    
    ans = 0
    for t_i in t:
        if t_i==0:
            ans+=1
    print(ans)

if __name__ == "__main__":
    main()

# Optimized solution
n,k = tuple(map(int,input().split()))
ans = [1]*n
for i in range(k):
  d = int(eval(input()))
  a_i = tuple(map(int,input().split()))
  for a_ij in a_i:
    ans[a_ij-1] = 0
    
print((sum(ans)))
# Original solution
N, K = list(map(int, input().split()))
d = []
A = []

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

cnt = {}
for i in range(N):
    cnt.setdefault(str(i + 1), 0)

for Ai in A:
    for Aij in Ai:
        cnt[str(Aij)] += 1

ans = 0
for key, val in list(cnt.items()):
    if val == 0: ans += 1

print(ans)

# Optimized solution
N, K = list(map(int, input().split()))
d = []
A = []
for _ in range(K):
    d.append(int(eval(input())))
    A.append(list(map(int, input().split())))

cnt = {}
for i, Ai in enumerate(A):
    for j, Aij in enumerate(Ai):
        key = str(Aij)
        cnt.setdefault(key, 0)
        cnt[key] += 1

ans = 0
for i in range(1, N + 1):
    key = str(i)
    cnt.setdefault(key, 0)
    ans += int(cnt[key] == 0)

print(ans)
# Original solution
(n,_),*t=[t.split()for t in open(0)][::2]
print((int(n)-len(set(sum(t,[])))))

# Optimized solution
n,_,*t=''.join([*open(0)][::2]).split()
print((int(n)-len({*t})))
# Original solution
N, K = list(map(int, input().split()))
sunuke_who_has_sweets = set()
for i in range(K):
  d = int(eval(input()))
  sunuke_who_has_sweets |= set(map(int, input().split()))
print((N - len(sunuke_who_has_sweets)))

# Optimized solution
N,K = list(map(int,input().split()))
r = set()
for i in range(K):
  d = int(eval(input()))
  r |= set(map(int,input().split()))
print((N-len(r)))
# Original solution
n, k = list(map(int, input().split()))
i = 0
a = list()
d = 0
while i<k:
    d += int(eval(input()))
    a += (list(map(int, input().split())))
    i += 1
i=0

while i<d:
    x = d-1
    while x > i:
        if a[x] < a[x-1]:
            c = a[x]
            a[x] = a[x-1]
            a[x-1] = c
        x -= 1
    i+=1

i=0
ans = a[0] - 1
while i<d-1:
    if a[i+1] - a[i]>1:
        ans += a[i+1] - a[i] -1
    i+=1
if a[d-1] != n:
    ans += n - a[d-1]

print(ans)


# Optimized solution
n, k = list(map(int, input().split()))
i = 0
a = list()
d = 0
while i<k:
    d += int(eval(input()))
    a += (list(map(int, input().split())))
    i += 1
i=0

b = [0]*n
while i<d:
    b[a[i]-1]=1
    i+=1

i=0
ans = 0
while i<n:
    if b[i] ==0:
        ans += 1
    i+=1

print(ans)
# Original solution
def main():
    n, k = list(map(int, input().split()))
    snack = set()
    for _ in range(k):
        eval(input())
        a = set(list(map(int, input().split())))
        snack |= a
    print((n-len(snack)))
        

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n, k = list(map(int, input().split()))
    sunukes = set()
    for _ in range(k):
        eval(input())
        sunukes |= set(list(map(int, input().split())))
    print((n-len(sunukes)))

if __name__ == "__main__":
    main()
# Original solution
def main():
    n, k = list(map(int, input().split()))
    sunukes = set()
    for _ in range(k):
        eval(input())
        sunukes |= set(list(map(int, input().split())))
    print((n-len(sunukes)))

if __name__ == "__main__":
    main()

# Optimized solution
def main():
    n, k = list(map(int, input().split()))
    a = set()
    for i in range(k):
        eval(input())
        a |= set(list(map(int, input().split())))
    print((n-len(a)))

if __name__ == "__main__":
    main()
# Original solution
N, K = list(map(int, input().split()))

snuke = [0] * N

# K 回ループ
for i in range(K):
    d = int(eval(input())) # A の要素数

    # A をリストとして受け取る
    A = list(map(int, input().split()))

    for j in range(d):
        snuke[A[j] - 1] = 1

ans = 0

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

print(ans)


# Optimized solution
N, K = list(map(int, input().split()))
S = [1] * N
for i in range(K):
    d = int(eval(input()))
    A = list(map(int, input().split()))
    for j in A:
        S[j - 1] = 0
print((S.count(1)))
# Original solution
from collections import Counter

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

for j in range(k):
  d = int(eval(input()))
  a = list(map(int, input().split()))
  for f in a:
    b.append(f)
print((n - len(Counter(b))))    

# Optimized solution
n, k = list(map(int, input().split()))
l = [0] * n
for i in range(k):
    d = int(eval(input()))
    x = list(map(int, input().split()))
    for j in range(d):
        l[x[j]-1] += 1
print((l.count(0)))
# Original solution
N, K = list(map(int, input().split()))

has_snack = set()
for i in range(K):
    d = int(eval(input()))
    A = set(map(int, input().split()))
    has_snack |= A

print((N-len(has_snack)))

# Optimized solution
N, K = list(map(int, input().split()))
has_snack = [False]*N
# has_snack: 1つ以上のお菓子を持っているかどうか
# has_snack[i] = True なら、すぬけ君i+1は1つ以上のお菓子を持っている

for i in range(K):
    d = int(eval(input()))  # d を読む (使わないけど)
    A = list(map(int, input().split()))  # A を読む
    for v in A:  # A の各要素 v について、
        has_snack[v-1] = True  # すぬけ君vは1つ以上のお菓子を持っている

# sum(has_snack) で1つ以上のお菓子を持っているすぬけ君の人数を求める
# ↑ 暗黙に、Trueは1、Falseは0に変換される
# 求めたいのは1つも持っていないすぬけ君の人数なので、総数Nから引く
print((N - sum(has_snack)))