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

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

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

l = []

for i in range(K):
    _ = input()
    l = set([*l, *list(map(int, input().split()))])
print(N-len(l))

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

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

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

i=0
A=[]
for a in range(K):
    M=[]
    P=input()
    M= list(map(int, input().split()))
    A=A+M
for b in range(1,N+1):
    if b not in A:
        i+=1

print(i)

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

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

Solution (Python):






def main():
    N,K = map(int, input().split())
    having = [False]*(N)
    for _ in range(K):
        d = int(input())
        for a in map(int, input().split()):
            having[a-1] = True

    print(len(list(filter(lambda b: not b, having))))

main()

Solution (Python):
import numpy as np

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

matrix = np.zeros(shape=(k, n))

for row in range(k):
  _ = int(input())
  fn = [int(i) for i in input().split()] 
  for col in fn:
	  matrix[row, col - 1] = 1 

print(np.count_nonzero(matrix.sum(axis=0)==0, axis=0))

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

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

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

print(cnt.count(0))

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

print(sum(map(lambda x: 1 if x == 0 else 0, s)))

Solution (Python):
import collections

N, K = map(int, input().split())
d = []
A = []

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

c = collections.Counter(A)

print(N - len(c.keys()))

Solution (Python):
import numpy as np
a,b=map(int,input().split())
c=np.zeros(a)
for i in range(b):
  input()
  x=list(map(int,input().split()))
  for i in x:
    if c[i-1]==0:
      c[i-1]=1
    else:
      pass
print(int(a-sum(c)))

Solution (Python):
def getInts():
    return [ int(x) for x in input().split() ]

[N,K] = getInts()
haveSnak = set()
for i in range(K):
    [d] = getInts()
    xs = getInts()
    for x in xs:
        haveSnak.add(x)
count = 0
for i in range(1,N+1):
    if i not in haveSnak:
        count += 1
print(count)

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

Solution (Python):
n,snack=map(int,input().split())
l=[]
for i in range(1,n+1):
  l.append(i)
l=set(l)
for i in range(snack):
  d=int(input())
  t=set(map(int,input().split()))
  l=l-t
print(len(l))

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

if __name__ == "__main__":
    main()

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

ans = 0
for j in range(1, N+1):
  if j in A:
    pass
  else:
    ans += 1

print(ans)

Solution (Python):
Sunuke=[]

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

    Sunuke.extend(A)

print(N-(len(set(Sunuke))))

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

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

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

print(len(ans))

Solution (Python):
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(input().split())
 
print(N - len(tmp))

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

s = set()

for i in range(k):
    input()
    s |= set(input().split())
    
print(n-len(s))

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

fed_snukes = set()
for d in range(k):
  __ = int(input())
  sn = set(int(i) for i in input().split())
  fed_snukes.update(sn)

print(n - len(fed_snukes))

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

Solution (Python):
N, K = map(int, input().split())
 
tmp = [0] * N
 
for i in range(K):
  input()
  for j in map(int, input().split()):
    tmp[j-1] |= 1 
print(N - sum(tmp))

Solution (Python):
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp.update(map(int, input().split()))
 
print(N - len(tmp))

Solution (Python):
N, K = map(int, input().split())
 
tmp = set()
 
for i in range(K):
  input()
  tmp |= set(map(int, input().split()))
 
print(N - len(tmp))

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

Solution (Python):

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

d = [0] * n

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

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

print(ans)

Solution (Python):

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

d = [0] * n

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

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

print(ans)

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

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

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

lista = []
for i in range(N):
  lista.append(i+1)
for i in range(K):
  d = int(input())
  a = list(map(int, input().split()))
  for j in range(len(a)):
    if a[j] in lista:
      lista.remove(a[j])

print(len(lista))

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

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

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

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

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

while k > 0:
    d = int(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))

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

C = [0 for _ in range(N)]
ct = N
for i in range(K):
  d = input()
  A = list(map(int, input().split()))
  for a in A:
    if C[a-1] == 0:
      C[a-1] += 1
      ct -= 1

print(ct)

Solution (Python):
N,K = map(int,input().split())
from collections import defaultdict
dic = defaultdict(int)
for _ in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        dic[a] = 1
print(N-len(dic))

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

d=[]
a=[]
sunuke=np.zeros(n)

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

Solution (Python):
N,K = map(int,input().split())
from collections import defaultdict
dic = defaultdict(int)
for _ in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        dic[a] = 1
print(N-len(dic))

Solution (Python):
N, K = map(int, input().split())
res = set()
for _ in range(K):
    input()
    for a in map(int, input().split()):
        res.add(a)

print(N - len(res))

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

for k in range(K):
  input()
  S|=set(input().split())

print(N-len(S))

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

print(cld.count(0)-1)

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

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

print(ans.count(1))

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

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

print(ans.count(1))

Solution (Python):

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

sunuke = [None] * N
for i in range(K):
  d = int(input())
  a = map(int, input().split())
  for t in a:
    sunuke[t-1] = 1

print(sunuke.count(None))

Solution (Python):
N,K=map(int,input().split())
d=[] 
A=[] 
A_union=[]
U=[i for i in range(1,N+1)]

for i in range(K): 
    d.append(int(input())) 
    A.append(list(map(int,input().split()))) 
for j in range(K): 
    A_union+=A[j] 
print(len(set(U)-set(A_union)))

Solution (Python):
def resolve():
    N, K = list(map(int, input().split()))
    uni = set()

    for _ in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        uni = uni.union(set(A))
    print(N - len(uni))
    return

resolve()

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

for i in range(k):
    d = int(input())
    a = (list(map(int, input().split())))
    for j in a:
        m[j-1] = False
        
ans = [i for i in range(n) if m[i]]
print(len(ans))

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

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

def main():
    N, K = map(int, input().split())
    people = set([])
    for _ in range(K):
        d = input()
        A = set(input().split())
        people |= A
    print(N - len(people))


if __name__ == '__main__':
    main()

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

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

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

t = 0
for i in range(1,n+1):
    if a.count(i) == 0:
        t += 1

print(t)

Solution (Python):

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

while k > 0:
    d = int(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))

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

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

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

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

Solution (Python):
N , K = map(int, input().split())
has = set()
for _ in range(K):
    d = int(input())
    has |= set(map(int, input().split()))
print(N - len(has))

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

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

print(a.count(0))

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

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

print(a.count(0))

Solution (Python):
def main():
    N, K = map(int, input().split(' '))
    d = [0] * N
    total = 0
    for i in range(K):
        A = input()
        B = list(map(int, input().split(' ')))
        for j in B:
            d[j - 1] = 1
    for j in range(N):
        if d[j] == 0:
            total += 1
    print(total)
main()

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

for i in range(k):
    d = int(input())
    a = list(map(int,input().split()))
    for hasperson in a:
        has[hasperson - 1] = True
print(has.count(False))

Solution (Python):

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

ni = [0]*n

while k > 0:
    d = int(input())
    a = list(map(int,input().split()))
    k -= 1
    for i in a:
        ni[i-1] = 1

print(ni.count(0))

Solution (Python):
n, k = map(int, input().split())
ls = []
for i in range(n):
    ls.append(1)
for i in range(k):
    input()
    ts = map(int, input().split(' '))
    for t in ts:
        ls[t-1] = 0
print(sum(ls))

Solution (Python):
def main():
    n, k = map(int, input().split())
    snack = set()
    for _ in range(k):
        input()
        a = set(list(map(int, input().split())))
        snack |= a
    print(n-len(snack))
        

if __name__ == "__main__":
    main()

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

has_snck = {}
for i in range(1, n + 1):
    has_snck[i] = False
for ai in a:
    for aij in ai:
        has_snck[aij] = True

ans = 0
for snk in has_snck.keys():
    if not has_snck[snk]:
        ans += 1
print(ans)

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

Solution (Python):
n,k = map(int,input().split())
nnin = []
for m in range(1,n+1):
    nnin.append(m)
for b in range(k):
    d  = int(input())
    a = list(map(int,input().split()))
    for s in a:
        if s in nnin:
            nnin.remove(s)
print(len(nnin))

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

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

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

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

Solution (Python):
import sys
def Ii():return int(sys.stdin.buffer.readline())
def Mi():return map(int,sys.stdin.buffer.readline().split())
def Li():return list(map(int,sys.stdin.buffer.readline().split()))
 
n,k = Mi()
b = [1]*(n+1)
for i in range(k):
  d = Ii()
  a = Li()
  for j in a:
    b[j] = 0
    
print(sum(b)-1)

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

for _ in range(K):
    D = int(input())
    A = list(map(int, input().split()))
    for d in range(D):
        if ans[A[d]-1] == None:
            ans[A[d]-1] = True

print(ans.count(None))

Solution (Python):
N,K = map(int,input().split())
people = []
for i in range(K):
    di = int(input())
    Aij = list(map(int,input().split()))
    for A in Aij:
        if A not in people:
            people.append(A)
print(N-len(people))

Solution (Python):
n, k = map(int, input().split())
lst = [0 for _ in range(n)]

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

cnt = 0
for i in range(len(lst)):
    if lst[i] == 0:
        cnt += 1

print(cnt)

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



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

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

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

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

Solution (Python):
N, K = map(int, input().split())
i = 1
lstA = []
while (i < K + 1):
  lstd = list(map(int, input().split()))
  lstA0 = list(map(int, input().split()))
  for a in lstA0:
    lstA.append(a)
  i += 1
 
j = 1
lst2 = []
while(j < N + 1):
  if(j not in lstA):
    lst2.append(j)
  j += 1
 
print(len(lst2))

Solution (Python):
N, K = map(int, input().split())
i = 1
lstA = []
while (i < K + 1):
  lstd = list(map(int, input().split()))
  lstA0 = list(map(int, input().split()))
  for a in lstA0:
    lstA.append(a)
  i += 1

j = 1
lst2 = []
while(j < N + 1):
  if(j not in lstA):
    lst2.append(j)
  j += 1

print(len(lst2))

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

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

Solution (Python):
n,k = map(int,input().split())
no_okashi_set = set(range(1,n+1))
for _ in range(k):
    input()
    no_okashi_set -= set(map(int,input().split()))
    
print(len(no_okashi_set))

Solution (Python):
N , K = map(int, input().split())
has = set()
for _ in range(K):
    d = int(input())
    has |= set(map(int, input().split()))
print(N - len(has))

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

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

all_A = []

for _1 in A:
    for _2 in _1:
        all_A.append(_2)

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

Solution (Python):
N, K = map(int, input().split())
sunuke = [0 for _ in range(N)]
for _ in range(K):
    d = int(input())
    As = list(map(int, input().split()))
    for a in As:
        sunuke[a-1] = 1
print(sunuke.count(0))

Solution (Python):
N, K = map(int,input().split())
S = set(range(1,N+1))
for _ in range(K):
    input()
    A = set(map(int,input().split()))
    S -= A

print(len(S))

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

Solution (Python):
import collections

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

num = collections.Counter(cnt)
print(N - len(num))

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

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


for i in range(n):
    ans+=1
    key=0
    for j in range(k):
        for l in range(d[j]):
            if i+1==A[j][l]:
                ans-=1
                key=1
            if key==1:
                break
        if key==1:
            break

print(ans)

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

cnt = [0]*n

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

ans = 0

for c in cnt:
    if c == 0:
        ans += 1


print(ans)

Solution (Python):
n,k = map(int,raw_input().split(' '))
h = set([])
for _ in range(k):
	di = int(raw_input())
	for ii in map(int, raw_input().split(' ')):
		h.add(ii)
print n - len(h)

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

out = 0
for i in range(N[0]):
    if S[i] == 0:
        out += 1

print(out)

Solution (Python):
import sys

def trick_or_treat(in_):
    n, k = map(int, in_.readline().split())
    
    snacks = set()
    for _ in range(k):
        d = int(in_.readline())
        snacks.update(map(int, in_.readline().split()))

    snaks = frozenset(range(1, n + 1))
    no_snacks = snaks - snacks
    return len(no_snacks)


def main():
    answer = trick_or_treat(sys.stdin.buffer)
    print(answer)


if __name__ == '__main__':
    main()

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

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

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

for i in range(len(A)):
    for j in range(len(A[i])):
        chi[A[i][j]] = 1
print(chi.count(0)-1)

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

ans = [False] * (n)

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

print(ans.count(False))

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

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

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

    list_i = [0]*N

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

    cnt = 0
    for judge in list_i:
        if judge == 0:
            cnt += 1

    return cnt

print(main())

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

dp = [0]*n

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

print(dp.count(0))

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 i in A:
        s.add(i)
print(N-len(s))

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

child = [0]*N

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

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

print(ans)

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

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

ans = 0

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

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

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')







def solve():
    N, K = MI()
    snuke = [0] * N
    for i in range(K):
        d = II()
        for s in LI1():
            snuke[s] += 1

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


if __name__ == '__main__':
    solve()

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

ans_list = []
sunuke_set = set(list(range(1, N + 1)))

for i in range(1, K * 2 + 1, 2):
    ans_list += table[i]

ans_set = set(ans_list)

print(len(sunuke_set - ans_set))

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

alis = set(range(1 , n + 1))

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

print(len(alis))

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

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

Solution (Python):

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


ans = [1]*N



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

print(ans.count(1))

Solution (Python):
from collections import Counter

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

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

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 a in A:
        L[a-1]+=1
print(L.count(0))

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

Solution (Python):
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    n, k = map(int, readline().split())
    memo = set()
    cnt = 0
    for _ in range(k):
        d = int(readline())
        memo |= set(map(int, readline().split()))
    for i in range(1, n + 1):
        if i not in memo:
            cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

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

records = []
for i in range(K):
    d = input()
    records.extend([int(_) for _ in input().split()])

records = list(set(records))
print(N-len(records))

Solution (Python):
from sys import stdin
data = stdin.readlines()

n = int(data[0].split()[0])
k = int(data[0].split()[1])

l = []

for i in range(1,k+1):
    num = int(data[2*i-1].split()[0])
    for j in range(0,num):
        l.append(int(data[2*i].split()[j]))

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

Solution (Python):
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    n, k = rl()
    snacks = set()
    for i in range(k):
        d = ri()
        for s in rl():
            snacks.add(s)
    print (n - len(snacks))






mode = 's'

if mode == 'T':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

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

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

print(n_list.count(0))

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

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

Solution (Python):
n,k= map(int,input().split())
kasi = {}
for i in range(k):
    _=int(input())
    for c in list(map(int,input().split())):kasi[c]=kasi.get(c,[])+[i]
print(sum([1 if not i in kasi.keys() else 0 for i in range(1,n+1)]))

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

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

for i in range(k):
  d = int(input())
  l = list(map(int, input().split()))
  for ii in range(d):
    no = l[ii]
    di[no] +=1

ans = 0
for i in di.values():
  if i == 0:
    ans += 1

print(ans)