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())
d = []
A = []
for _ in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))



snuke = [False] * N
for i in range(K):
    for j in range(d[i]):
        snuke[A[i][j] - 1] = True

print(snuke.count(False))

Solution (Python):
from collections import Counter

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

sunuke = [0]*N
for i, A_list in okasi:
    for k in A_list:
        sunuke[k-1] += 1

print(Counter(sunuke)[0])

Solution (Python):

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

ans_set = set()
for i in range(K):
    _ = int(input())
    ans_set |= set(list(map(int, input().split())))

print(N - len(ans_set))

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

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 j in range(d):
        ans[a[j]-1]=True

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

print(pr)

Solution (Python):


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

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

ans=0
for s in S:
    if s==0: ans+=1

print(ans)

Solution (Python):


ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]
mp = lambda :map(int,input().split())

n,k = mp()
dt = {}
for i in range(1,n+1):
    dt[i] = 0
for i in range(k):
    d = inp()
    x = ip()
    for i in x:
        dt[i] = 1
print(list(dt.values()).count(0))

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

L = [1]*N
for i in range(K):
    B = A[i]
    for S in B:
        L[S-1]=0

print(sum(L))

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

Solution (Python):
import itertools
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush,heapify
import math
from copy import deepcopy
import queue

Mod = 1000000007
  
def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))+1):
        if prime[i] == 1:
            for j in range(2*i,n+1):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n+1):
        if prime[i] == 1:
            res.append(i)
    return res

 
class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py
 
    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

def main():  
    n, k = map(int, input().split())
    d = []
    a = []
    for i in range(k):
        d.append(int(input()))
        a.append(list(map(int, input().split())))
    snuke = [0] * n
    for i in range(k):
        for j in range(d[i]):
            snuke[a[i][j]-1] += 1
    ans = 0
    for i in range(n):
        if snuke[i] == 0:
            ans += 1
    print(ans)
if __name__ == "__main__":
    main()

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


a = [1]*(n+1)
for i in range(k):
    di=input()
    *aij,=map(int, input().split( ))
    for ij in aij:
        a[ij]=0
print(sum(a)-1)

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

for i in range(K):
    input()
    for a in list(map(int,input().split())):
        pos[a-1]=1
cnt=0
for i in range(N):
    if pos[i]==0:
        cnt+=1
print(cnt)

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

Solution (Python):
N,K=map(int,input().split())
have=set()
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for a in A:
    have.add(a)
ans=0
for n in range(N):
  n+=1
  if n not in have:
    ans+=1
print(ans)

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

snk = [0]*n

for i in range(k):
    d = int(input())
    ai = [int(i) for i in input().split()]
    for j in range(d):
        snk[ai[j]-1] = 1

ans = 0

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

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

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

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

print(ans)

Solution (Python):
N, K = map(int, input().split())
D = [0] * K
A = [0] * K
have = set()
for i in range(K):
    D[i] = int(input())
    A = [int(a) for a in input().split()]
    have = have | set(A)

print(N - len(have))

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

ans = n
for i in range(n):
    if a[i] != 0:
        ans -= 1

print(ans)

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

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

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

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

M = set([])
for i in range(N):
  M.add(i+1)

for i in range(K):
  d = int(input())
  L = list(map(int, input().split()))
  for j in range(len(L)):
    if L[j] in M:
      M.remove(L[j])

print(len(M))

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

s=[0]*n

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

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

Solution (Python):
N,K=map(int,input().split())
D=[]
A=[0 for _ in range(N)]
for _ in range(K):
    d=int(input())
    a=map(int,input().split())
    D.append(a)
for z in D:
    for y in z:
        A[y-1]+=1
print(A.count(0))

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

for i in range(len(da)):
  if i%2==0:
    continue
  else:
    for j in da[i]:
      c[j-1]+=1
      
for i in c:
  if i==0:
    ans+=1
    
print(ans)

Solution (Python):
from sys import stdin
N,K = [int(x) for x in stdin.readline().rstrip().split()]
tmp = set()
for i in range(K):
    d = int(stdin.readline().rstrip())
    A = [int(x) for x in stdin.readline().rstrip().split()]
    tmp = tmp | set(A)
print(len(set(range(1,N+1))-tmp))

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

Solution (Python):
n, k = map(int, input().split())
d = []
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())
trick = [1 for i in range(n)]

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

print(sum(trick))

Solution (Python):
def main():
    N,K = map(int,input().split())
    have = set()
    for _ in range(K):
        d = int(input())
        a = list(map(int,input().split()))
        for z in a:
            have.add(z)
    print(N-len(have))
if __name__ == "__main__":
    main()

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 i in a:
    if ans[i-1] != 0:
      ans[i-1] = 0
print(sum(ans))

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

a_all_list = []
for _ in range(k):
    d = int(input())
    a_list = list(map(int, input().split()))
    for a in a_list:
        if a not in a_all_list:
            a_all_list.append(a)

print(n-len(a_all_list))

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

Solution (Python):
N, K = [int(i) for i in input().split(" ")]
n = [0 for _ in range(N)]

for i in range(K):
    num = int(input())
    D = [int(j) for j in input().split(" ")]
    for d in D:
        n[d-1] += 1

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

print(ans)

Solution (Python):


def input_one_number():
    return int(input())

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

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

N,K = input_multiple_number()

isTaz = [True]*N

for i in range(K):
	d = int(input())
	a = input_multiple_number_as_list()
	for _a in a:
		isTaz[_a-1] = False

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

print(ans)

Solution (Python):
N, K = list(map(int, input().strip().split()))
S = set(range(1, N+1))

for k in range(K):
  d = int(input())
  A = list(map(int, input().strip().split()))
  S = S - set(A)
  
print(len(S))

Solution (Python):




n, k = map(int,input().split())
snlist = [0] * (n + 1)

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

ans = 0
for k in range(1, n+1):
    if snlist[k] == 0:
        ans = ans + 1


print(ans)

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 = map(int, input().split())
d = []
A = []
for i in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

l = [0] * N

for i in range(K):
    for j in range(d[i]):
        l[A[i][j]-1] += 1

print(l.count(0))

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

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

Solution (Python):
N,K = map(int,input().split(" "))
ans = N
snuke = [False] * (N + 1)
for i in range(K):
    d = int(input())
    A = list(map(int,input().rstrip().split(" ")))
    for i2 in range(d):
        if snuke[A[i2]] == False:
            snuke[A[i2]] = True
            ans -= 1
print(ans)

Solution (Python):



import sys
input = sys.stdin.readline

def main():
    N, K = map(int, input().split())
    tlist = []
    for i in range(K):
        di = int(input())
        li = list(map(int, input().split()))
        tlist += li
    tset = set(tlist)
    print(N-len(tset))

if __name__ == '__main__':
    main()

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

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

print(s.count(0))

Solution (Python):
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))

N, K = MAP()

s = [0] * N
d, A = [], []
for i in range(K):
    d = INT()
    ai = LIST()
    for aii in ai:
        s[aii-1] += 1

print(s.count(0))

Solution (Python):
import sys

sys.setrecursionlimit(10**6)
readline = sys.stdin.readline


def main():
    
    N, K = map(int, readline().split())
    okashi = [0] * N
    for i in range(K):
        d = int(input())
        A = list(map(int, readline().split()))
        for a in A:
            okashi[a-1] += 1
    
    ans = 0
    for o in okashi:
        if o == 0:
            ans += 1
    print(ans)


if __name__ == "__main__":
    main()

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

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

Solution (Python):

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

Solution (Python):

import re
import math
from collections import defaultdict
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache

readline=sys.stdin.readline
sys.setrecursionlimit(2000000)

alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def get_facs(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
def hani(x,min_,max_):
    ret=x
    if x<min_:ret=min_
    if x>max_:ret=max_
    return ret
def seifu(x):
    return x//abs(x)

def f():
    return
def main():
    n,k=map(int,input().split())
    S=set()
    for a in range(k):
        input()
        A=list(map(int,input().split()))
        for b in A:
            S.add(b)
    print(n-len(S))
main()

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

A = []

for k in range(K):
    d = input()
    A+=input().split()
ans = N - len(set(A))

print(ans)

Solution (Python):
n,k = map(int,input().strip().split())
ls = [0]*n
for _ in range(k):
    d = int(input())
    temp = list(map(int,input().strip().split()))
    for val in temp:
        ls[val-1] = 1
c = 0
for val in ls:
    if val==0:
        c += 1
print(c)

Solution (Python):
n, k = [int(i) for i in input().split()]
lis = [False] * n

for _ in range(k):
    _d = int(input())
    for a in input().split():
        i = int(a) - 1
        lis[i] = True

print(len(list(filter(lambda a: not a, lis))))

Solution (Python):
n,k=map(int,input().split())
dlist=[]
alist=[i+1 for i in range(n)]

for j in range(k):
    dlist.append(int(input()))
    tmplist=list(map(int,input().split()))
    for tmp in tmplist:
        if tmp in alist:
            alist.remove(tmp)

print(len(alist))

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

B = [False for _ in range(N + 1)]
for _ in range(K):
    _ = input()
    for i in map(int, input().split()):
        B[i] = True

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

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

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

print(n-len(a))

Solution (Python):
n,k = map(int,input().split())
nn = []
for i in range(n):
    nn.append(i+1)
    
ans = []
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        if j in nn:
            nn.remove(j)
print(len(nn))

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

ls = set()

for k in range(K):
    d = input()
    A = list(map(int, input().split()))
    for a in A:
        ls.add(a)

print(N - len(ls))

Solution (Python):
n, k = map(int, input().split())
import numpy as np
A = np.zeros(n)
for i in range(k):
  _ = int(input())
  a = np.array(list(map(int, input().split())))
  A[a-1] += 1
print(sum(A == 0))

Solution (Python):
n,k = [int(x) for x in input().split()]
a = []
for _ in range(k):
    _ = input()
    tmp = [int(x) for x in input().split()]
    for x in tmp:
        a.append(x)

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

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

Solution (Python):
n, k =map(int, input().split())
used = [False] * (n + 10)
for i in range(k):
    x = int(input())
    
    dat = list(map(int, input().split()))
    
    for j in range(len(dat)):
        used[dat[j]] = True
res = 0

for i in range(n):
    
    if used[i + 1] is False:
        res += 1
print(res)

Solution (Python):
if __name__ == "__main__":
    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:
            if j not in s:
                s.add(j)
    
    ans = n - len(s)
    print(ans)

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

Solution (Python):

import sys

stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip() 


def main():
    n,k = na()
    ans = [i for i in range(n)]
    for _ in range(k):
        d = ni()
        As = na()
        for a in As:
            if a-1 in ans:
                ans.remove(a-1)
    print(len(ans))
    return


if __name__ == '__main__':
    main()

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

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

Solution (Python):
n,k=map(int,input().split())
cnt={}
for i in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  for j in a:
    if j in cnt:  
      pass
    else:
      cnt[j]=1
print(n-len(cnt))

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

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

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

Solution (Python):


import sys

sys.setrecursionlimit(10 ** 8)
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N, K = map(int, readline().split())
cands = [0] * N
for i in range(K):
    _ = readline()
    a = list(map(int, readline().split()))
    for x in a:
        cands[x - 1] += 1


def solve():
    
    return sum(1 for c in cands if c == 0)


if __name__ == "__main__":
    print(solve())

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

def main():
    N, K = map(int, input().split())
    T = [0] * N
    for _ in range(K):
        d = int(input())
        for a in map(int, input().split()):
            T[a-1] += 1
    print(len([1 for t in T if 0 == t]))

if __name__ == '__main__':
    main()

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

ans = [0]*n

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

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

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

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

print(S.count(0))

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

Solution (Python):
import sys

N, K = map(int, sys.stdin.readline().strip().split())

snukes = [0] * N
for i in range(K):
    d = int(sys.stdin.readline().strip())
    A = list(map(int, sys.stdin.readline().strip().split()))
    for a_i in A:
        snukes[a_i-1] += 1

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

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

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

print(ans)

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

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

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

ans = 0

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

print(ans)

Solution (Python):
mod = 10**9+7
import sys
from collections import Counter, defaultdict, deque
from itertools import product, permutations, combinations, combinations_with_replacement
from itertools import accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from math import ceil,floor
from copy import deepcopy
from heapq import heappop,heappush,heapify
import heapq







sys.setrecursionlimit(10 ** 6)

int1 = lambda x: int(x) - 1


p2D = lambda x: print(*x, sep="\n")

def II(): return int(sys.stdin.readline())

def MI(): return map(int, sys.stdin.readline().split())
def MI1(): return map(int1, sys.stdin.readline().split())




def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LI(): return list(map(lambda x:int(x), sys.stdin.readline().split()))
def HI(): return list(map(lambda x:int(x)*(-1), sys.stdin.readline().split()))


n,k = MI()
d = []
a = []
for _ in range(k):
	tmp = II()
	d.append(tmp)
	tmp = LI()
	for i in (tmp):
		a.append(i)
p = n -len(list(set(a)))
print(p)

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

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

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


def readstr():
    return input().strip()


def readint():
    return int(input())


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


def readstrs():
    return input().split()


N, K = readnums()
d = []
A = []
for _ in range(K):
    d = readint()
    a = list(readnums())
    for x in a:
        A.append(x)

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

Solution (Python):
from math import sqrt,ceil,floor
def mi():return map(int,input().split())
def li():return list(mi())
def ii():return int(input())

n,k=mi()
m=[0]*(n+1)
for i in range(k):
    d=ii()
    a=li()
    for i in a:
        m[i]+=1
        
m=m[1:]
print(m.count(0))

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

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

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

for i in range(k):
    d=int(input())
    for i in input().split():
        l[int(i)-1]+=1

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

print(s)

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

print(sum(Flag))

Solution (Python):
import numpy as np
import math
n,k = map(int,input().split())
ans = [0 for i in range(n+1)]
for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for j in a:
        if ans[j] == 0:
            ans[j] += 1

num = 0
for i in ans:
    num += i

print(n-num)

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

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

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

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

print(count)

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

ans = [0]*n


for _ in range(k):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        if ans[a-1]==0:
            ans[a-1]=1

print(n-sum(ans))

Solution (Python):
from sys import stdin, setrecursionlimit

setrecursionlimit(10 ** 9)


def input():
    return stdin.readline().strip()

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

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

ans = set(range(1, N+1)) - s
print(len(ans))

Solution (Python):

N, K = [int(str) for str in input().strip().split()]


def solve():
    is_have = [False] * N
    for k in range(K):
        d = int(input().strip())
        A = [int(str) - 1 for str in input().strip().split()]
        for a in A:
            is_have[a] = True
    print(sum([1 for a in is_have if not a]))


solve()

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

ans = [1] * n
for x in a:
    for i in x:
        ans[i - 1] = 0

print(sum(ans))

Solution (Python):
n, k = map(int, input().split())
d = []
a = []
for i in range(k):
    d.append(int(input()))
    line = list(map(int, input().split()))
    a += line
a_set = set(a)
cnt = 0
for i in range(1,n+1):
    if not i in a_set:
        cnt += 1
print(cnt)

Solution (Python):
N, K = [int(x) for  x in input().split()]
l = []
for i in range(K):
  d = int(input())
  l2 = [int(x) for x in input().split()]
  for j in range(d):
    if l2[j] not in l:
      l.append(l2[j])
print(N - len(l))

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

Solution (Python):
N, K = map(int, input().split())
s = [0] * N
for _ in range(K):
    d = int(input())
    for a in map(int, input().split()):
        s[a-1] += 1

ans = len([1 for x in s if x == 0])
print(ans)

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

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

treat = [1 for i in range(n)]

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

print(sum(treat))