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-----
3 2
2
1 3
1
3

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
n, k = map(int, input().split())
snukes = []
for _ in range(k):
    okashi = int(input())
    snukes += [int(v) for v in input().split()]
target = 1
cnt = 0
l = list(set(snukes))
s = [int(v) for v in range(1, n + 1)]

for p in s:
    if p not in l:
        cnt += 1
print(cnt)

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

print((n - len(a)))


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

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

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

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

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

print((sunuke.count(0)))


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

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


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

# 各人ごとに、持っているお菓子の個数を数え、個数0の人数を出力する
l = [0]*N
for i in range(K):
  for j in range(D[i]):
    l[A[i][j]-1] +=1

print(l.count(0))

N, K = map(int, input().split())
sweets = [0] * N

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

    for a in A:
        sweets[a-1] += 1

print(sweets.count(0))

N,K=map(int,input().split())
s = set(range(1, N+1))
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for x in A:
        try:
            s.remove(x)
        except:
            pass
print(len(s))

n,k=map(int, input().split())
a=[]
d=[]
for i in range(k):
  d.append( int(input()) )
  a.append( list(map(int,input().split())) )
mem=0
for i in range(1,n+1):
  check=False
  for j in range(k):
    if i in a[j]:
      check=True
  if not check:
    mem+=1
print(mem)           

n, k = list(map(int, input().split()))
A = []
A_dup = []
cnt = 0

for i in range(k):
    input()
    # A.append(list(map(int, input().split())))
    A_dup += list(map(int, input().split()))
A_eldup = list(set(A_dup))

for i in range(1, n+1):
    if i not in A_eldup:
        cnt += 1
print(cnt)


n, k = map(int, input().split())
s = [0] * n

for _ in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for x in a:
        s[x-1] = 1

print(s.count(0))

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

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

n,k=map(int,input().split());s={*range(1,-~n)}
for _ in range(k):
 input();s-={*map(int,input().split())}
print(len(s))

N,K=map(int,input().split())
A=[]
people=list(range(1,N+1,1))
for idx in range(K):
    d=int(input())
    X=list((map(int,input().split())))
    for i in range(len(X)):
        A.append(X[i])
ans =[i for i in people if not i in A]
print(len(ans))

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

sunuke = [1] * N

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

N, K = map(int, input().split())
x = [0] * (N+1)

for i in range(K):
    d = int(input())
    if d > 0:
        a = list(map(int, input().split()))
        for v in a:
            x[v] += 1

# print(a)

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

print(c)

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

s = [i for i in range(1,n+1)]
for _ in range(k):
  d = int(input())
  arr = list(map(int, input().split()))
  for a in arr:
    if a in s:
	    s.remove(a)
print(len(s))

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

#N人　K種類のお菓子
[N, K] = [int(i) for i in input().split()]

okasi = [0]*N #i番目の人が持っているお菓子の中で、種類番号が多いものに更新する

#お菓子K種類渡す
for k in range(K):
    num = int(input()) #お菓子の番号
    have = [int(i) for i in input().split()]
    for snuke in have:
        okasi[snuke-1] = num

#お菓子持ってない人を探す
print(okasi.count(0))

import itertools

N,K = map(int,input().split())
# 2次元配列
d = []
A = []
for i in range(K):
	d.append(int(input()))
	array = list(map(int, input().strip().split()))
	A.append(array)

#A[][]からの要素を取り出して重複しないリストXを作りたい
X=list(itertools.chain.from_iterable(A))
X=list(set(X))

#Xはお菓子をもらった人のリスト
print(N-len(X))

import itertools

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

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

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

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

sunuke = [1] * n

for i in range(k):
    d = int(input())
    oka = map(int,input().split())
    for j in oka:
        sunuke[j-1] = 0
        
print(sum(sunuke))

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

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

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

table = [0] * N
for _ in range(K):
  num = int(input())
  have_list = list(map(int, input().split()))
  for child in have_list:
    table[child-1] += 1

print(str(table.count(0)))

N, K = map(int, input().split())
count = 0
num_people = []
num_people_snacks = []
for i in range(1, N + 1):
    num_people.append(i)

while K > count:
    d = int(input())
    A = list(map(int, input().split()))
    for k in A:
        num_people_snacks.append(k)
    count += 1

ans = 0
for j in range(N):
    if num_people[j] not in num_people_snacks:
        ans += 1
        
print(ans)

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

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

dst = [1] * N

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

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

print((sum(dst)))


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

# お菓子を持っている人を数える。すると持っていない人間は、Nから持っている人の数を引いたもの
l = [0]*N
for i in range(K):
  for j in range(D[i]):
    l[A[i][j]-1] = 1

print(N - sum(l))

n, k = map(int, input().split())
a = set({})
for i in range(k):
  d = int(input())
  for j in input().split():
  	a.add(j)
print(n - len(a))    

n, k = map(int, input().split())
snukes = [False] * n
for _ in range(k):
	d = int(input())
	a = list(map(int, input().split()))
	A = [n-1 for n in a]
	for i in range(d):
		snukes[A[i]] = True
print(snukes.count(False)) 

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

a = sum(a, [])
count = 0
for i in range(n):
  if i+1 in a:
    continue
  count+=1

print(count)

import itertools
n,k = map(int,input().split())
ans = 0
l = []
for i in range(k) :
    d = int(input())
    l.append(input().split())

l = list(itertools.chain.from_iterable(l))
l = [int(i) for i in l]

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

def __starting_point():

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

    A = [0] * n

    for _ in range(k):
        m = int(input())
        B = list(map(int,input().split()))
        for b in B:
            A[b-1] += 1
    print((A.count(0)))

__starting_point()

n, k = list(map(int, input().split()))
l1 = []
safe = []
ans = 0
for i in range(k):
    d = int(input())  # お菓子を持ってる人の合計
    l = list(map(int, input().split()))
    safe += l
for i in range(1, n+1):
    if i not in list(set(safe)):
        ans += 1
print(ans)


a,b = map(int,input().split())
w = []
t = {}
for i in range(b):
    c = int(input())
    s = list(map(int,input().split()))
    w +=s
t = set(w)
print(a-len(t))

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

N,K=map(int,input().split())
P=[1 for i in range(N)]

for i in range(K):
    d=int(input())
    a=list(map(int,input().split()))
    for j in a:
        x=j-1
        P[x]=0

print(sum(P))

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

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

sunuke = [0]*n

for _ in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    if d <= 1:
        sunuke[a[0]-1] += 1
    else:
        for i in range(d):
            sunuke[a[i]-1] += 1

#print(sunuke)
print((sunuke.count(0)))


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

s = {i:0 for i in range(n+1)} 

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

cnt = -1

for i in s:
  if s[i] == 0:
    cnt +=1

print(cnt)



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


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

N,K = map(int,input().split())
d = [0 for _ in range(K)]
A = [[] for _ in range(K)]
for i in range(K):
    d[i] = int(input())
    A[i] = list(map(int,input().split()))
su_list = [i for i in range(1,N+1)]
for i in range(K):
    for j in range(d[i]):
        if A[i][j] in su_list:
            su_list.remove(A[i][j])        
print(len(su_list))

N, K = list(map(int, input().split()))
lst = list(range(1, N+1))
for _ in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    lst = list(set(lst) - set(A))
print((len(lst)))


n,k=map(int,input().split());n,c=set(range(1,n+1)),set()
for i in range(k):
  input();c|=set(map(int,input().split()))
print(len(n^c))

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

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

n, k = map(int, input().split())
s = set()
for _ in range(k):
    tmp = int(input())
    arr = list(map(int, input().split()))

    for a in arr:
        s.add(a)

print(n - len(s))

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

for i in range(k):
    d=int(input())
    A+=list(map(int,input().split()))
    list(set(A))
cnt=0
for i in range(n):
    if i+1 not in A:
        cnt+=1
print(cnt)


s,value = map(int,input().split())
li = []
for j in range(s):
    li.append(j+1)

for i in range(value):
    n = int(input())
    li_s = list(map(int,input().split()))
    for k in range(n):
        if li_s[k] in li:
            li.remove(li_s[k])
            
print(len(li))

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

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

candy = [0 for i in range(N)]
for i in range(K):
  for j in range(d[i]):
    candy[A[i][j]-1] += 1
print(candy.count(0))

def N():
    return int(input())
def L():
    return list(map(int,input().split()))
def NL(n):
    return [list(map(int,input().split())) for i in range(n)]
mod = pow(10,9)+7
#import numpy
n,k = L()
l = [1]*n
for i in range(k):
    d = N()
    a = L()
    for j in a:
        l[j-1] = 0
print(l.count(1))

N, K = (int(x) for x in input().split())
listN = [1] * N
# N is population / K is candy
for i in range(K):
    d = int(input())
    tmp = list(map(int, input().split()))
    for j in tmp:
        listN[j-1] = 0
print((sum(listN)))


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

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())))
#print(d)
#print(a)

lis = []
for i in range(k):
    for j in range(len(a[i])):
        lis.append(a[i][j])
lis = set(lis)
print((n - len(lis)))


def main():
    n, k = list(map(int, input().split()))
    d = set()
    for i in range(k):
        input()
        d.update(list(map(int, input().split())))
    print(n - len(d))

def __starting_point():
    main()
__starting_point()

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

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

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

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

s = []

for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for i in range(d):
        s.append(a[i])
        
t = sorted(s)
a = len(t)
x = n

for i in range(n):
    for k in range(a):
        if i + 1 == t[k]:
            x -= 1
            break
        elif i + 1 < t[k]:
            break
        
print(x)


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

ns = {x for x in range(1, N + 1)}

for _ in range(K):
    _ = input()
    ns -= set(map(int, input().split()))

print((len(ns)))


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

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

    check = [0] * n
    for _ in range(k):
        _ = input()
        having = tuple(map(int, input().split()))
        for idx in having:
            check[idx-1] += 1
    print((check.count(0)))
    return


def __starting_point():
    main()

__starting_point()

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


N,*D=open(0);print(int(N.split()[0])-len(set(sum([a.split()for a in D[1::2]],[]))))

n,k=map(int,input().split());s=set(range(1,-~n))
for _ in range(k):
 input();s-=set(map(int,input().split()))
print(len(s))

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


N,K = map(int,input().split())
d = []
A = []
for i in range(K):
    p = int(input())
    q = [int(i) for i in input().split()]
    d.append(p)
    A.append(q)
S = [False]*N
for i in range(K):
    for j in range(d[i]):
        S[A[i][j]-1] = True
print(S.count(False))

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

a = set()
ans = 0
for i in range(K) :
    for j in range(len(A[i])) :
        a.add(A[i][j])

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

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


#print(A)
sunukes = [0]*N
for i in range(K):
    for j in range(d[i]):
        #print(A[i][j])
        sunukes[A[i][j]] += 1
#print(sunukes)
ans = 0
for s in range(N):
    if sunukes[s] == 0:
        ans += 1

print(ans)

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


N,K=list(map(int, input().split()))
num_list = []
for i in range(2*K):
    num_list.append(list(map(int,input().split())))

list1=[]
s=0
while s<2*K-1:
    list1.append(num_list[s+1])
    s=s+2

list2=[]
for i in range(K):
    x=len(list1[i])
    t=0
    while t<x:
        list2.append(list1[i][t])
        t=t+1

z=len(set(list2))
print((N-z))


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


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

from typing import Union, List


def answer(n: int, k: int, da: List[Union[int, List[int]]]) -> int:
    result = set()
    for d, a in da:
        result |= set(a)

    return n - len(result)


def main():
    n, k = map(int, input().split())
    da = [[int(input()), list(map(int, input().split()))] for _ in range(k)]
    print(answer(n, k, da))


def __starting_point():
    main()
__starting_point()

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

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

ans = [0]*100

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

print(n-sum(ans))

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

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

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

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

    for j in range(d):
        sunukes[aa[j] - 1] += 1

count = sum(1 for sunuke in sunukes if sunuke == 0)

print(count)


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

sunuke = [False] * n

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

    for j in range(d):
        sunuke[a[j] - 1] = True 

cnt = 0
for i in range(n):
    if sunuke[i] == False:
        cnt += 1

print(cnt)


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

#ABC166
n,k=map(int,input().split())
cnt=[0]*(n+1)
for j in range(k):
  tmp = int(input())
  arr=list(map(int,input().split()))
  for val in arr:
    cnt[val]+=1
ans=0
for i in range(1,n+1):
  if cnt[i]==0:
    ans+=1
print(ans)

import sys
from collections import deque, defaultdict, Counter
from itertools import accumulate, product, permutations, combinations
from operator import itemgetter
from bisect import bisect_left, bisect_right
from heapq import heappop, heappush
from math import ceil, floor, sqrt, gcd, inf
from copy import deepcopy
import numpy as np
import scipy as sp

INF = inf
MOD = 1000000007

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

tmp = [True for i in range(n + 1)]
res = 0

for i in range(k):
    for j in range(d[i]):
        tmp[A[i][j]] = False
for i in range(1, n + 1):
    if tmp[i]:
        res += 1

print(res)


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

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


# 166 B
N, K = list(map(int, input().split()))
A = []
for i in range(K):
    d = int(input())
    a = []
    if d > 1:
        a = list(map(int, input().split()))
        A.extend(a)
    else:
        A.append(int(input()))
        
print(N - len(set(A)))

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

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

for members in A:
    for member in members:
        sunuke[member - 1] = 1

print((N - sum(sunuke)))


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

treat = [0] * N

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

print(treat.count(0))

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

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

print((N - len(set(l))))




n,k=[int(i) for i in input().split()]
a=[0 for i in range(n)]
for i in range(k):
    x=input()
    t=[int(i) for i in input().split()]
    for j in t:
        a[j-1]+=1
ans=0
for i in a:
    if i==0:
      ans+=1
print(ans)


import sys
def input(): return sys.stdin.readline().rstrip()

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

d = []
A = []

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

vec = [0] * N

for a in A:
    for i in a:
        i -= 1
        vec[i] += 1

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

print(ans)
        
    




n,k=map(int,input().split())
ans=[1]+[0]*n
for i in range(k):
    d=int(input())
    l=list(map(int,input().split()))
    for i in l:
        ans[i]=1
print(ans.count(0))

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

for _ in range(k):
  input()
  for x in input().split():
    m[int(x)] += 1

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

import collections
n, k = map(int, input().split())
sunukes = [0]*n

for i in range(k):
  d = int(input())
  aa = list(map(int, input().split()))
  for a in aa:
    sunukes[a-1] += 1
c = collections.Counter(sunukes)

ans = c[0]

print(ans)

N,K=map(int,input().split())
ans=list()
for i in range(K):
  D=int(input())
  L=list(map(int,input().split()))
  ans+=L
  ans=list(set(ans))
print(N-len(ans))

n,k = input().split()

h = {}
for i in range(int(n)):
  h[int(i)+1] = 0

for i in range(int(k)):
  input()
  tmp = input().split()
  
  for j in tmp:
    h[int(j)] += 1
    
count = 0
for i,j in h.items():
  if j == 0:
    count += 1
print(count)

radi=input()
list=radi.split(" ")
N=int(list[0])
K=int(list[1])
empty=""
for items in range(K):
    koyjon=input()
    empty+=input()+" "
new=empty.split()
emp=[]
for i in new:
    if i not in emp:
        emp.append(i)
print((N-len(emp)))




import numpy as np
n,k = list(map(int, input().split()))
l = [0 for i in range(n)]
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        l[j-1] = 1

print((l.count(0)))


N,K=map(int,input().split())
sunuke = [0]*N

for _ in range(K):
    d = int(input())
    temp = list(map(int,input().split()))
    for j in temp:
        sunuke[j-1]+=1

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

import math
def i_input(): return int(input())
def i_map(): return list(map(int, input().split()))
def i_list(): return list(map(int, input().split()))
def i_row(N): return [int(input()) for _ in range(N)]
def i_row_list(N): return [list(map(int, input().split())) for _ in range(N)]

mnum,snum=i_map()
snholder=set()
for i in range(snum):
    d=i_input()
    ls=i_list()
    snholder=snholder | set(ls)
print((mnum-len(snholder)))