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):
NM=list(map(int,input().split()))
person=[0 for i in range(NM[0])]
for i in range(NM[1]):
    d=input() 
    snack=list(map(int,input().split()))
    for i in snack:
        person[i-1]=1
d=0
for i in range(len(person)):
    if person[i]==0:
        d+=1
print(d)

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

x = set()
for i in range(K):
    d = input()
    for i in input().split():
        x.add(i)
print(N - len(x))

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

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

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

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

print(ans)

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

x = set()
for n in range(K):
    d = input()
    for n in input().split():
        x.add(n)
print(N - len(x))

Solution (Python):
n,k=map(int, input().split())
pepele=set()
for _ in range(k):
    candies = input()
    pepele |= set(map(int, input().split()))


print(n-len(pepele))

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

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

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

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:
        L.append(j)
        
print(N-len(set(L)))

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

Solution (Python):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n,k=map(int,stdin.readline().split())
ans=n
done=defaultdict(lambda:False)
for _ in range(k):
    d=int(input())
    a=list(map(int,stdin.readline().split()))
    for i in a:
        if(i not in done):
            ans-=1
            done[i]=True
print(ans)

Solution (Python):
import math
import time
from collections import defaultdict,deque
from sys import stdin,stdout
from bisect import bisect_left,bisect_right
n,k=map(int,stdin.readline().split())
ans=n
done=defaultdict(lambda:False)
for _ in range(k):
    d=int(input())
    a=list(map(int,stdin.readline().split()))
    for i in a:
        if(i not in done):
            ans-=1
            done[i]=True
print(ans)

Solution (Python):
def resolve():
	n, k = map(int, input().split())
	seq = [0]*n
	for i in range(k):
		_d = int(input())
		g = list(map(int, input().split()))
		for p in g:
			seq[p-1] += 1
	print(seq.count(0))
resolve()

Solution (Python):
n, k = map(int, input().split())
n = list(map(str, range(1, n+1)))

for i in range(k):
    _ = input()
    a = input().split()
    for ai in a:
        for ni in n:
            if ai == ni:
                n.remove(ai)
print(len(n))

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

sunuke = [0]*N

for i in range(K):
    d = input()
    a = input()
    for j in a.split():
        sunuke[int(j)-1] = 1


print(sunuke.count(0))

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

a=[List[2*j+1] for j in range(K)]
print(N-len(set(sum(a,[]))))

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

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

sweet_people = []
for i in range(K):
  for j in range(d[i]):
  	sweet_people.append(A[i][j])
diff = all_people ^ set(sweet_people)
diff = list(diff)
print(len(diff))

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

A = [0] * n

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

    for j in A_okashi:
        if A[j-1] == 0:
            A[j-1] = 1

print (A.count(0))

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

A = [0] * n

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

    for j in A_okashi:
        if A[j-1] == 0:
            A[j-1] = 1

print (A.count(0))

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

Solution (Python):
from math import sqrt

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

Solution (Python):



def main():
    number_of_human,number_of_sweets = map(int,input().split())
    
    human_own_information_list = []
    
    for sweets_number in range(number_of_sweets):
        number_of_own_human = int(input())
        own_human_list = list(map(int,input().split()))
        for own_human in own_human_list:
            if not own_human in human_own_information_list:
                human_own_information_list.append(own_human)
    
    result = 0
    for human_number in range(1,number_of_human+1):
        if not human_number in human_own_information_list:
            result += 1
    
    print(result)


if __name__ == "__main__":
    main()

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


print(l.count(0))

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

r = set()
for _ in range(k):
  d = int(input())
  r |= set(map(int, input().split()))
print(n-len(r))

Solution (Python):
n,k = map(int,input().split())
s = [0]*n
a = set()
for i in range(k):
    d = int(input())
    snu = set(map(int,input().split()))
    a = a | snu
print(n - len(a))

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

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

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):
N,K= (int(x) for x in input().split(' '))
N = [i for i in range(1,N+1)]
d_lst = []
for i in range(0,K):
    d = int(input())
    d_lst.append(d)
    A= [int(x) for x in input().split(' ')]
    N.extend(A)

print(len([x for x in set(N) if N.count(x) == 1]))

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

print(N-len(A))

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

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):
import itertools
import math
import fractions
import functools
n, k = map(int, input().split())
a = []
for i in range(k):
    di = int(input())
    ai = list(map(int, input().split()))
    a.append(ai)

count=set()

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

print(n-len(count))

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

d = list()
[d.append(list(input().split())) for i in range(K * 2)]
print(N - len(set(sum(d[1::2], []))))

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

d = list()
d = [d + list(input().split()) for i in range(K * 2)]
print(N - len(set(sum(d[1::2], []))))

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

n = set()
for i in range(K):
    ds = input()
    n = n | set(input().split())

print(N - len(n))

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

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

print(N - len(n))

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

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

print(len(n) - sum(n))

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


non_given =[]
for i in range(N):
    non_given.append(i+1)

for i in range(K):
    for j in range(len(A[i])):
        if(A[i][j] in non_given):
            non_given.remove(A[i][j])

print(len(non_given))

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

s = set()

for i in range(K):
    d = int(input())
    As = input().split()
    s |= set(As)

print(N - len(s))

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

n, k = map(int, input().split())
have = [0] * (n + 1)
for i in range(k):
	d = int(input())
	a = list(map(int, input().split()))
	for x in a:
		have[x] += 1
res = 0
for i in range(1, n + 1):
	if have[i] == 0:
		res +=1 
print(res)

Solution (Python):
n ,k = [int(x) for x in input().split()]
dg = [0]*(n+1)
while(k):
    di = int(input())
    a = [int(x) for x in input().split()]
    for i in a:
        dg[i]+=1
    k-=1

cnt = -1
for i in dg:
    cnt+=(i==0)
print(cnt)

Solution (Python):
[N, K] = list(map(int, input().split()))
all_A =[]
AB = []
for i in range(1, N + 1):
    all_A.append(i)
for j in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    AB = AB + A
last_A = set(all_A) ^ set(AB)
print(len(last_A))

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 j in a:
        cnt[j - 1] += 1

print(cnt.count(0))

Solution (Python):
def main(n, a):
    indexes = {i + 1 for i in range(n)}
    reduced = set()
    for s in a:
        reduced |= s
    return len(indexes - reduced)


if __name__ == '__main__':
    N, K = map(int, input().split())
    A = []
    for _ in range(K):
        input()
        A.append(set(tuple(map(int, input().split(' ')))))
    print(main(N, A))

Solution (Python):
m,t=map(int,input().split())
c=0
ar=[]
for i in range(t):
    n=(int)(input())
    l=list(map(int,input().split()))
    for i in range(n):
        ar.append(l[i])
ans=len(set(ar))
print(m-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 i in range(d):
    ans[a[i]-1]=0
print(sum(ans))

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

L = [True] * N
for i in range(K):
    d = input()
    l = [int(a.strip()) for a in input().split()]
    for a in l:
        L[a-1] = False

ans = sum(v==True for v in L)
print(ans)

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

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

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

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

N = inp[0]
K = inp[1]

sunuke_w_okashi = []

for okashi in range(K):
    _ = input()
    inp = inp = list(map(int, input().split()))
    sunuke_w_okashi = sunuke_w_okashi + inp

num_sunuke_wo_okashi = N - len(set(sunuke_w_okashi))

print(num_sunuke_wo_okashi)

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

s_set = set()
for i in range(K):
    d = int(input())
    l_d = [int(x) for x in input().split()]
    for d in l_d:
        s_set.add(d)

print(N-len(s_set))

Solution (Python):
okashimochi_set = set()
N_set = set()

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

for n in range(N):
    N_set.add(n + 1)
    n = n + 1

for i in range(K):
    d = int(input())
    A = input().split()
    for a in range(d):
        okashimochi_set.add(A[a])

result = len(N_set) - len(okashimochi_set)
print(result)

Solution (Python):
def main():

    N, K = map(int, input().split())
    p = set()
    for _ in range(K):
        d = int(input())
        A = list(map(int, input().split()))
        for i in range(d):
            p.add(A[i])
    return N - len(p)

if __name__ == '__main__':
    print(main())

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

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

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

print(ans)

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

print(n - len(set(okashi_lst)))

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

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

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

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

A = [0] * N

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

print(A.count(0))

Solution (Python):



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


snuke = [0]*N
ans = 0


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


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


print(ans)

Solution (Python):
from sys import stdin


n, k = stdin.readline().rstrip().split()
n = int(n)
k = int(k)
A_lst = []

for i in range(k):
  d = int(stdin.readline().rstrip())
  a_lst = [int(a) for a in stdin.readline().rstrip().split()]
  A_lst.extend(a_lst)
    
A_set = set(A_lst)
print(n - len(A_set))

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

for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        if j-1 in tricked_set:
            tricked_set.remove(j-1)

print(len(tricked_set))

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

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

print(flag.count(False))

Solution (Python):
import itertools

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

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

ans_li = list(itertools.chain.from_iterable(sunuke))

count = 0
for i in range(N):
    if i+1 not in ans_li:
        count += 1

print(count)

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

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

while k:
    k -= 1
    d = int(input())
    ad = list(map(int,input().split()))
    for e in ad:
        a[e] = 1
print(a.count(0))

Solution (Python):
N, K = map(int, input().split())
sunukes = {i for i in range(1,N+1)}

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

print(len(sunukes))

Solution (Python):
import sys

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

d = [None]*k
a = [None]*k

syugou = []
for i in range(k):
    d[i] = int(input())
    a[i] = [int(j) for j in input().split()]

    syugou = syugou+a[i]

num = set(syugou)

print(n-len(num))

Solution (Python):
import sys

sys.setrecursionlimit(10**7)

stdin = sys.stdin

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

n, k = na()
l = [1] * n
for i in range(k):
    d = ni()
    a = na()
    for i in range(d):
        l[a[i] - 1] = 0
print(sum(l))

Solution (Python):

import sys
sys.setrecursionlimit(10**7)


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

ans = []
for k in range(K):
    d = input().rstrip()
    for i in input().rstrip().split():
        ans.append(i)

print(N - len(set(ans)))

Solution (Python):
"""
~~ author : dokueki
~~ created : 10~05~2020
"""

import sys
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
sys.setrecursionlimit(10**7)
mod = 1000000007


def IOE():
    sys.stdin = open("input.txt", "r")
    sys.stdout = open("output.txt", "w")


def main():
    n, k = map(int, sys.stdin.readline().split())
    v = set()
    for i in range(k):
        d = int(sys.stdin.readline())
        a = list(map(int, sys.stdin.readline().split()))
        for i in a:
            v.add(i)
    print(n - len(v))


if __name__ == "__main__":
    try:
        IOE()
    except:
        pass
    main()

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

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

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

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

Solution (Python):
N, K = [ int(i) for i in input().strip().split(' ') ]
counter = [ 0 for _ in range(N) ]
for k in range(K):
    d = int(input())
    for a in [ int(i) for i in input().strip().split(' ') ]:
        counter[a-1] += 1

c_0 = [ c for c in counter if c == 0]
print(len(c_0))

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

for i in range(N):
    A.append(0)

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

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

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

mem = [i + 1 for i in range(n)]
for i in range(n):
    for s in a:
        if (i + 1) in s:
            mem.remove(i + 1)
            break
        
print(len(mem))

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

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

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

for i in range(1,N+1):
    list1.append(i)

for j in range(K):
    d =int(input())
    lista = list(map(int,input().split()))
    for l in lista:
        for h in list1:
            if (l==h):
                list1.remove(h)

print(len(list1))

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

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(S.count(1))

Solution (Python):
a,b = map(int,input().split(" "))
ar = [0 for i in range(a)]
for i in range(b):
    j = int(input())
    br = list(map(int,input().split(" ")))
    for r in br:
        ar[r-1] += 1
print(ar.count(0))

Solution (Python):
n,k=map(int,input().split())
dic={}
for i in range(n):
	dic[i+1]=0
for _ in range(k):
	f=input()
	a=list(map(int,input().split()))
	for j in a:
		dic[j]+=1
ans=0

for i in dic:
	if(dic[i]==0):
		ans+=1
print(ans)

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

list_n=[]
for i in range(1,N+1):
    list_n.append(i)
    
t=[]
for i in range(K):
    d=int(input())
    s=list(map(int,input().split()))
    t+=s
    
s=list(set(t))
s.sort()

cnt=0
for i in list_n:
    if i not in s:
        cnt+=1
        
print(cnt)

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


for _ in range(K):
    tmp = int(input())
    kashi += tuple(map(int, input().split()))
print(N - len(set(kashi)))

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


for _ in range(K):
    tmp = int(input())
    for j in tuple(map(int, input().split())):
        kashi.append(j)
        
print(N - len(set(kashi)))

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

for _ in range(K):
    tmp = int(input())
    for j in list(map(int, input().split())):
        kashi.append(j)
        
print(N - len(set(kashi)))

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

Solution (Python):
input_line = input()
input_line = input_line.split()
N = int(input_line[0])
K = int(input_line[1])
data = [0] * N

for i in range(K):
  temp = int(input())
  person = input()
  person = person.split()
  for j in range(len(person)):
    data[int(person[j]) - 1] += 1

count = 0
for i in range(N):
  if data[i] == 0:
    count += 1

print(count)

Solution (Python):
import itertools
N,K=map(int,input().split())
l=[0]*N
n=0
for i in range(K):
  d=int(input())
  have=list(input().split())
  for j in have:
    l[int(j)-1]=1

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

Solution (Python):
N, K = map(int, input().split())
sunuke = set(i for i in range(1, N+1))
given =set()
for i in range(K):
    di = map(int, input().split())
    gi = set(map(int, input().split()))
    given = given | gi

itazura = N - len(given)
print(itazura)

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

Solution (Python):
import itertools
import math
import fractions
import functools

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

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

print(count.count(0)-1)

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

print(a.count(0))

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

Solution (Python):
first_line = list(map(int, input().split()))
N = first_line[0]
K = first_line[1]
rest = list(range(1, N+1))
for i in range(K):
  d = int(input())
  given = list(map(int, input().split()))
  for j in range(1, N+1):
    if j in given and j in rest:
      rest.remove(j)

print(len(rest))

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

for i in child:
    for j in range(K):
        for k in range(d[j]):
            if i == int(A[j][k]):
                non_child.remove(i)
                break
        else:
            continue
        break

print(len(non_child))

Solution (Python):
N,K=map(int,input().split())
D=[]
A=[]
for i in range(K):
    d=int(input())
    D.append(d)
    Ai=[int(x) for x in input().split()]
    A.append(Ai)
NUMBERS=[int(x) for x in range(1,N+1)]
for i in range(K):
    for j in range(D[i]):
        if A[i][j] in NUMBERS:
            NUMBERS.remove(A[i][j])
        else:
            pass
print(len(NUMBERS))

Solution (Python):

N,K= map(int, input().split())
Sunuke={}
for i in range(K):
    dn = int(input())
    Having_List =list(map(int,input().split()))
    for Having in Having_List:
        if Having not in Sunuke:
            Sunuke[Having]=1 
    
print(N-len(Sunuke))

Solution (Python):
total,okasi=map(int,input().split())
sunuke=[]
for i in range(okasi):
  d=int(input())
  A=list(map(int,input().split()))
  for a in A:
    sunuke.append(a)
    
    
ans=total-len(set(sunuke))
 
print(ans)

Solution (Python):
N_nin, K_ko = map(int, input().split())

sunuke = []

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


ans = N_nin - len(set(sunuke))

print(ans)

Solution (Python):


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


def main() -> None:
    """Entry point
    """
    
    
    persons = set()
    for A_i in A:
        for A_ij in A_i:
            persons.add(A_ij)

    result = N - len(persons)

    
    print(result)


if __name__ == "__main__":
    main()

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

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

for i in range(k):
    n_all = n_all - set(a[i])
print(len(n_all))

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

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


for _ in range(K):

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

    for j in range(D):

        ans[pre+j]=arr[j]

    pre += D

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

print(fin)

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

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

Solution (Python):

import sys

import heapq
import re
import bisect
import random
import math
import itertools
from collections import defaultdict, deque
from copy import deepcopy
from decimal import *

readl= lambda: list(map(int, sys.stdin.readline().split()))
readt= lambda: tuple(map(int, sys.stdin.readline().split()))
read = lambda: sys.stdin.readline().rstrip()
readi = lambda: int(read())
readmi = lambda: map(int, sys.stdin.readline().split())
readms = lambda: map(str, sys.stdin.readline().split())

n, k = readmi()
d = [0] * n
for i in range(k):
    t = readi()
    p = readl()
    for j in p:
        d[j - 1] = 1

print(n - sum(d))

Solution (Python):
N, K = (int(num) for num in input().split(" "))
cnt = 0
dic = {i+1: 0 for i in range(N)}
while cnt < K:
    d = input()
    a = input().split(" ")
    for n in a:
        dic[int(n)] += 1
    cnt += 1

treated = 0
for key in dic:
    if dic[key] == 0:
        treated += 1
print(treated)

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

ans = set()
for q in range(k):
    d = int(input())
    a = set(map(int, input().split()))
    ans = ans | a


print(n - len(ans))

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

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

ans = sum([c == 0 for c in check])
print(ans)

Solution (Python):
from copy import copy
from functools import reduce
    
class Sunuke:
    def __init__(self):
        self.has_snack = False
    
n_sunuke, n_v_snacks = [int(s) for s in input().split()]
    
all_sunuke = [copy(Sunuke()) for i in range(n_sunuke)]
    
for snack_id in range(n_v_snacks):
    n_snacks = int(input())
    for sunuke_id in (int(s) for s in input().split()):
        all_sunuke[sunuke_id - 1].has_snack = True
    
print(reduce(lambda n,s: n + (0 if s.has_snack else 1), all_sunuke, 0))

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

N1 = N +1
for o in range(1,N+1):
    D.append(o)
    



for i in range(K):
    A =int(input())
    C.append(A)
    B =list(map(int,input().split()))
    for z in B:
        for j in D:
            if j ==z:
                D.remove(j)


                
                
                

print(len(D))

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

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

for k in range(1, k + 1):
    input()
    for i in map(int, input().split()):
        d[i].append(k)

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

Solution (Python):
N, K = map(int, input().split())
uid_list = []
for _ in range(K):
   input()
   for uid in [int(i) for i in input().split()]:
       uid_list.append(uid)
print(N - len(set(uid_list)))

Solution (Python):
from collections import defaultdict

N, K = list(map(int, input().split()))
d = {}
for i in range(1, N+1):
    d[i] = []
for k in range(1, K+1):
    input()
    for i in map(int, input().split()):
        d[i].append(k)
count = 0
for i in range(1, N+1):
    if len(d[i]) == 0:
        count += 1
print(count)

Solution (Python):
a = 1;
treat = 0;
n, k = map(int, input().split());
 
data = list(input().split() for l in range(2*k))
 
 
while a <= n:
    b = 0;
    d = 0;
    
    while b < k:
        search = int(data[2*b][0]);
        c = 0;
        
        while c < search:
            x = int(data[2*b+1][c]);
            if x == a :
                d = d + 1;
            c = c + 1
            
        b = b + 1;
        
    if d == 0:
        treat = treat + 1;
        
    a = a + 1;
 
print(treat);

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

for i in range(1,N+1):
    list1.append(i)

for j in range(K):
    d =int(input())
    lista = list(map(int,input().split()))
    for l in lista:
        for h in list1:
            if (l==h):
                list1.remove(h)

print(len(list1))