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 = tuple(map(int, input().split()))

s = set()

for k in range(K):
  input()
  s = s | set(map(int, input().split()))
  
print(N-len(s))

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

Solution (Python):
N, K = list(map(int, input().split()))
ct = [0 for i in range(N+1)]

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

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

print(ans)

Solution (Python):
n,k=map(int,input().split())
l=[]
for i in range(k):
    d=int(input())
    x=[int(w) for w in input().split()]
    for j in range(len(x)):
        if x[j] not in l:
            l.append(x[j])
    
s=[i for i in range(1,n+1)]
ans=0
for i in s:
    if i not in l:
        ans+=1
print(ans)

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

Solution (Python):






inputs: list = []
while True:
    try:
        inputs.append(input().strip('\n'))
    except EOFError:
        break


n, k = [int(i) for i in inputs[0].split()]
snacks = inputs[1:]

nusukes = {i: False for i in range(1, 1 + n)}

for n, sn in enumerate(snacks):
    if n % 2 == 0:
        continue
    else:
        temp = [int(i) for i in sn.split()]
        for i in temp:
            nusukes[i] = True

counter = 0
for key, value in nusukes.items():
    if not value:
        counter += 1

print(counter)

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

for i in range(k):
    for j in range(d[i]):
        p[A[i][j]]=1
print(n-sum(p))

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

for i in range(k):
    d = input()
    a = set(list(input().split()))
    A = A | a

print(n - len(A))

Solution (Python):
import collections

N, K = map(int,input().split())
sunuke = [0]*N
for i in range(K):
    _ = input()
    n = map(int,input().split())
    for j in n:
        sunuke[j-1] +=1
sunuke = collections.Counter(sunuke)

print(sunuke[0])

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

a = set(a)
ans = 0

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

print(ans)

Solution (Python):
N, K = map(int, input().split())
okasi = set()
for i in range(K):
    d = int(input())
    a = set(map(int, input().split()))
    okasi = okasi | a
N = set(i + 1 for i in range(N))
print(len(N - okasi))

Solution (Python):
n,k=map(int,input().split())
li_d=[]
li_A=[]
for i in range(k):
    li_d.append(int(input()))
    li_A.append(input().split())
li=[]
for i in range(k):
    lis=li_A[i]
    li=li+lis
li=list(set(li))
print(n-len(li))

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

Solution (Python):
N, K = [int(i) for i in input().split()]

L = [0]*N

for i in range(K):
  d = int(input())
  A = [int(j) for j in input().split()]
  for a in A:
    L[a-1] += 1
    
print(L.count(0))

Solution (Python):
inputLine=input()
N=int(inputLine.split(" ")[0])
K=int(inputLine.split(" ")[1])

A = []
for i in range(K):
    inputLine=input()
    d = int(inputLine)
    inputLine=input()
    A.append(inputLine.split(" "))

allSunukeStates=[]
for i in range(N):
    allSunukeStates.append(True)

for i in range(len(A)):
    for j in range(len(A[i])):
        allSunukeStates[int(A[i][j]) - 1] = False

result = 0
for i in range(N):
    if allSunukeStates[i] == True:
        result += 1

print(result)

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

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

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

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

sunuke = [0]*N

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

Solution (Python):
n, k = list(map(int, input().split()))
sunuke = {x: 0 for x in range(1, n + 1)}
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for x in a:
        sunuke[x] += 1
print(len([k for k, v in sunuke.items() if v == 0]))

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

Solution (Python):
x = list(map(int,input().split()))
n = x[0]
k = x[1]
sunuke = [0]*n

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

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

print(count)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
printn = lambda x: print('\n'.join(x))

n, k = nm()
l = [0]*(n+1)
for _ in range(k):
    d = ni()
    f = nl()
    for x in f:
        l[x] += 1
g = sum(1 for i in range(1, n+1) if not l[i])
print(g)

Solution (Python):

import sys





import itertools
"""Template"""


class IP:
    """
    入力を取得するクラス
    """

    def __init__(self):
        self.input = sys.stdin.readline

    def I(self):
        """
        1文字の取得に使います
        :return: int
        """
        return int(self.input())

    def S(self):
        """
        1文字の取得(str
        :return: str
        """
        return self.input()

    def IL(self):
        """
        1行を空白で区切りリストにします(int
        :return: リスト
        """
        return list(map(int, self.input().split()))

    def SL(self):
        """
        1行の文字列を空白区切りでリストにします
        :return: リスト
        """
        return list(map(str, self.input().split()))

    def ILS(self, n):
        """
        1列丸々取得します(int
        :param n: 行数
        :return: リスト
        """
        return [int(self.input()) for _ in range(n)]

    def SLS(self, n):
        """
        1列丸々取得します（str
        :param n: 行数
        :return: リスト
        """
        return [self.input() for _ in range(n)]

    def SILS(self, n):
        """
        Some Int LineS
        横に複数、縦にも複数
        :param n: 行数
        :return: list
        """
        return [self.IL() for _ in range(n)]

    def SSLS(self, n):
        """
        Some String LineS
        :param n: 行数
        :return: list
        """
        return [self.SL() for _ in range(n)]


"""ここからメインコード"""


def main():
    
    r, e = range, enumerate
    ip = IP()

    """この下から書いてね"""
    
    
    
    
    
    n, k = ip.IL()
    memo = ip.SILS(2*k)[1::2]
    memo = list(itertools.chain.from_iterable(memo))
    memo = list(set(memo))
    memo = [x - 1 for x in memo]
    new = [1 for _ in range(n)]
    for x in memo:
        new[x] = 0
    print(sum(new))
    


main()

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

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

print(sum(1 for e in l if not e))

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

Solution (Python):
import math

n, k = map(int, input().split())
s = set()
for j in range(k):
	d = int(input())
	g = list(map(int, input().split()))
	for i in g:
		s.add(i)

print(n - len(s))

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

dic = {}
for i in range(K):
    _ = int(input())
    A = list(map(int, input().split()))
    for a in A:
        if not a in dic:
            dic[a] = 1

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

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

print(flag.count(0))

Solution (Python):
N, K = map(int, input().split())
D = []
A = []
result = []
for i in range(K*2):
    if i % 2 == 0:
        d = int(input())
        D.append(d)
    else:
        a = list(map(int, input().split()))
        A.append(a)

for a in A:
    for b in a:
        result.append(b)

print(N-len(set(result)))

Solution (Python):
N,K = map(int,input().split())
d = [list(map(int,input().split())) for _ in range(2*K)]
D = []
ans = 0
for i in range(K):
    k = d[2*i +1]
    for j in k:
        if j not in D:
            D.append(j)

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

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

d = []
A = []
for i in range(2*K):
    if i % 2 == 0:
        d.append(int(dA[i][0]))
    else:
        A.append(dA[i])

A2 = []
for i in range(K):
    for j in range(len(A[i])):
        A2.append(A[i][j])
sets = set(A2)
print(N-len(sets))

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

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

Solution (Python):
import numpy

n,k = map(int,input().split(" "))
d = []
a = []
tmp = numpy.zeros(n)
for i in range(k):
    d.append(int(input()))
    a.append([int(e) for e in input().split(" ")])

for i,dd in enumerate(d):
    for j in range(dd):
        tmp[a[i][j]-1] += 1

print(sum(tmp==0))

Solution (Python):
def main():
  n, k = map(int,input().split())
  params = [1]*n
  
  for _ in range(k):
    input()
    tmp = map(int, input().split())
    for i in tmp:
      params[i-1] = 0
  
  return sum(params)

print(main())

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

target = list(range(1, n + 1))

lst = []
for v in A:
	for j in range(len(v)):
		lst.append(v[j])

lst = set(lst)

print(n - len(lst))

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

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

d = list()

A_list = list()

for a in range(0, k):
    d.append(int(input()))
    A_list.append(list(map(int, input().split())))

count = [0]*n

for a in A_list:
    for b in a:
        count[b-1] += 1

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

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

print(n - len(set(lst)))

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

Solution (Python):

n,k =map(int, input().split())
sp = [input().split() for _ in range(k*2)]
get = []
for i in range(1,len(sp),2):
    for j in range(len(sp[i])):
        get.append(sp[i][j])
result = list(set(get))
print(n-len(result))

Solution (Python):

import sys


def solve(N, K, A):
    s = set()
    for a in A:
        for x in a:
            s.add(x)
    print(N - len(s))
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))
    K = int(next(tokens))
    A = [[] for _ in range(K)]
    for i in range(K):
        d = int(next(tokens))
        for j in range(d):
            A[i].append(int(next(tokens)))
    solve(N, K, A)

if __name__ == '__main__':
    main()

Solution (Python):
n,k=map(int, input().split())
l1=[]
for i in range(k):
    x=int(input())
    l=list(map(int, input().split()))
    for i in l:
        l1.append(i)
s=set(l1)
print(n-len(s))

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

print(snuke.count(False))

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

for k in range(1, K+1):
    d = input()
    l = list(map(int, input().split()))
    ans.extend(l)
ans = list(set(ans))
print(N-len(ans))

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

Solution (Python):
N, K = [int(x) for x in input().split()]
d = [0]*N
B = []
for n in range(K):
    i = int(input())
    A = [int(x) for x in input().split()]
    for j in range(i):
        B.append(A[j])
print(N-len(set(B)))

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

print(len(set(range(1, N+1)) - set(A)))

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

print(n-len(A))

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

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

okashi_count = list()

for p in range(N):
    okashi_count.append(0)

non_holder = 0

for n in range(K):
    _ = input()
    S = list(map(int, input().split()))
    for s in S:
        okashi_count[int(s) - 1] += 1

for l in okashi_count:
    if l == 0:
        non_holder += 1

print(non_holder)

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

sunuke = [0]*n

for i in range(k):
    x = int(input())
    l = map(int,input().split())
    for s in l:
        sunuke[s-1] += 1

print(sunuke.count(0))

Solution (Python):
from collections import Counter as counter

ii = lambda:int(input())
mi = lambda:list(map(int,input().split()))
ix = lambda x:list(input() for _ in range(x))
mix = lambda x:list(mi() for _ in range(x))
iix = lambda x:list(int(input()) for _ in range(x))


n,k = mi()
res = 0
a = []
for i in range(k):
    d = input()
    a.extend(mi())
c = counter(a)
for i in range(1,n+1):
    if c[i] == 0: res+=1
print(res)

Solution (Python):
n, k = map(int, input().split())
d_lis = []
person_lis = []
ans_lis = []
ans = []

for i in range(k):
    d_lis.append(int(input()))
    person_lis.append(list(map(int, input().split())))


for people in person_lis:
    for person in people:
        if person in ans_lis:
            pass
        else:
            ans_lis.append(person)

for i in range(1, n+1):
    if i in ans_lis:
        pass
    else:
        ans.append(i)
print(len(ans))

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

for i in range(K) :
    cnt.extend(A[i])

print(N - len(set(cnt)))

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

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

Solution (Python):
n,k = map(int,input().split())
ds = [[int(input()),list(map(int,input().split()))] for i in [0]*k]

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

for d in ds:
    tmp = set(d[1])
    s = s-tmp


ans = len(s)
print(ans)

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

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

		dpa[s[j]] = 1


print(n-len(dpa))

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

for row in range(k):
    for column in d_lst[row]:
        cookie[column-1] += 1

print(cookie.count(0))

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

s = [False] * n

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

ans = 0
for t in s:
    if t == False:
        ans += 1

print(ans)

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

snack = [0 for _ in range(n)]

for i in range(k):
    d = int(input())
    line = [int(s) - 1 for s in input().split()]
    
    for a in range(d):
        snack[line[a]] += 1

print(snack.count(0))

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

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


ss = set()

for i in range(1, k*2+1):
  
  if i%2==1:
    input()
  else:
    for s_i in map(int, input().split()):
      
      ss.add(s_i)

print(len([s for s in range(1, n+1) if s not in ss]))

Solution (Python):
def solution():
    n, k = map(int, input().split())
    s = [0]*n
    for i in range(k):
        d = int(input())
        a = [int(ss) for ss in input().split()]
        for aa in a:
            s[aa - 1] += 1

    print(s.count(0))

solution()

Solution (Python):
n,k=map(int,input().split())
dl=[]
ul=[]
for i in range(k):
    dl.append(int(input()))
    f=list(map(int,input().split()))
    ul.extend(f)
res=0
for i in range(1,n+1):
    if not i in set(ul):
        res+=1
print(res)

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

Solution (Python):
n, k = map(int, input().split())
ans = n
dic = {}

for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for j in range(d):
        if a[j] not in dic.keys():
            dic[a[j]] = True
            ans -= 1
print(ans)

Solution (Python):
FAST_IO = 0
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())



def solve(N, K, A):
    snackless = set(range(1, N+1))
    for row in A:
        for x in row:
            snackless.discard(x)
    return len(snackless)

N,K = rrm()
A = []
for _ in xrange(K):
    rri()
    A.append(rrm())
print solve(N, K, A)

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

print(n - len(s))

Solution (Python):
def main(N, K, d, A):
    a = list(set(sum(A, [])))
    print(N - len(a))

if __name__ == '__main__':
    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())))
    main(N, K, d, A)

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

Solution (Python):
N, K = map(int,input().split())
lists = []
listb = [1 for i in range(N)]

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

for i in lists:
    for j in i:
        listb[j-1] -= 1
    
cnt = 0

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

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

sunuke = [0 for _ in range(N)]
D = []
A = [[] for _ in range(K)]
for k in range(K):
    D.append(int(input()))
    A[k] = list(map(int, input().split()))
    for a in A[k]:
        sunuke[a-1] += 1

print(sunuke.count(0))

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

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

print(n - len(ans))

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


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

for i in range(K):
    syu  = A[i]
    for j in syu:
        kan[j-1] = -1


print(kan.count(0))

Solution (Python):



import math

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

s = set()

for i in range(0, K):
    d = int(input())
    As = map(int, input().split())
    for a in As:
        s.add(a)



print(N - len(s))

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

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

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

print(len(set(range(1, N + 1)).difference(s)))

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

Solution (Python):
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    SW = [0]*N
    for i in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for j in range(d):
            SW[A[j]-1] += 1
    CNT = 0
    
    for i in SW:
        if i == 0:
            CNT += 1
    print(CNT)

if __name__ == '__main__':
    main()

Solution (Python):
N,K=map(int,input().split())
sunuke=[]
for i in range(K):
  di=int(input())
  A=list(map(int,input().split()))
  for j  in range(di):
    if A[j] not in sunuke:
      sunuke+=[A[j]]
ans=N-len(sunuke)

print(ans)

Solution (Python):




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

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




if __name__ == '__main__':
    main()

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

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

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

    for j in range(l):
        if a[j] not in dic:
            dic.append(a[j])
        else:
            pass
    a.clear()

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

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

for i in range(k):
    d_list.append(int(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))

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

ans = [0 for i in range(N)]

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

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

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

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

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

print(A.count(0))

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

ans = [0]*(n+1)


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




for a in A:
    for _a in a:
        ans[_a] += 1

b = [1 for x in ans[1:] if x == 0]

print(sum(b))

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

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

Snack = [0] * N

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

    for j in range(d):
        Snack[A[j]-1] += 1
    
sum = 0
for i in range(N):
    if (Snack[i] == 0):
        sum += 1

print(sum)

Solution (Python):
import collections

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

res = []

for _ in range(k):
  s = int(input())
  ss = list(input().split())
  for i in ss:
      res.append(i)

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

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

for i in range(k):
    l = len(a[i])
    for j in range(l):
        s[a[i][j]] += 1

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

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

sunukeList = [0] * N
for holder in A:
    for sunuke in holder:
        sunukeList[sunuke-1] += 1

count = 0
for sunuke in sunukeList:
    if sunuke == 0:
        count += 1
print(count)

Solution (Python):
from sys import stdin

n, k = [int(x) for x in stdin.readline().rstrip().split()]

okashimap = {}

for i in range(1,k+1):
    d = int(stdin.readline().rstrip())
    an = list(map(int, input().split()))
    for j in range(d):
        okashimap[an[j]] = True 

trick = [x for x in range(1,n+1) if x not in okashimap.keys()]
print(len(trick))

Solution (Python):
a,b=map(int,input().split())

li=[0]*a
for i in range(b):
    a=input()

    li1=list(map(int,input().split()))
    for n in li1:
        li[n-1]+=1
print(li.count(0))

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

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

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

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

print(B.count(0))

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

from collections import Counter

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

s=set()

for i in range(K):
    d_i = int(input())
    snuke = set(list(map(int,input().split())))

    s=s|snuke

s_diff = snuke_s - s

print(len(s_diff))

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

Solution (Python):
n,k = map(int,input().split())
itazura = list(range(1,n+1))
for i in range(k):
    di = input()
    Ai = list(map(int,input().split()))
    for one in Ai:
        if one in itazura:
            itazura.remove(one)
print(len(itazura))

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

Solution (Python):









import os
import sys


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

if __name__ == "__main__":
    main()

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

Solution (Python):
N,K=map(int,input().split())
D=[]
SUN=[i for i in range(1,N+1)]
for i in range(K):
    D.append(int(input()))
    A=list(map(int,input().split()))
    for j in A:
        if j in SUN:
            SUN.remove(j)

print(len(SUN))

Solution (Python):
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
result=0
for i in range(N):
  if sunuke[i]==0:
    result+=1
print(result)

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

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

d = 0
A = set()

for i in range(K):
    d = int(input())
    Ai = set(map(int, input().split()))
    for ai in Ai:
        A.add(ai)

print(N-len(A))

Solution (Python):
n, k = map(int, input().split())
d_list = []
a_list = []
for i in range(k):
	d_list.append(int(input()))
	a_list.append(list(map(int, input().split())))
n_list = []
for i in range(n):
	n_list.append(i+1)
for a_s in a_list:
	if len(n_list) == 0:
		break
	for a in a_s:
		if a in n_list:
			n_list.remove(a)
print(len(n_list))