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 = [0 for _ in range(K)]
sunuke = [0 for _ in range(N)]

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

print(sunuke.count(0))

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

for i in range(n+1):
  if s.count(i) == 0:
    ans += 1
    
print(ans-1)

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

total_set = {0}
for i in range(K):
    d = int(input())
    A_set = set(map(int, input().split()))
    total_set = total_set | A_set

sunuke_set = {i for i in range(N+1)}

answer_set = sunuke_set - total_set
print(len(answer_set))

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

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

A = list()
treat = {}
for i in range(K):
    d = int(input())
    A = list(map(int,input().split()))
    for a in A:
        if a in treat.keys():
            treat[a] += 1
        else:
            treat[a] = 1

counter = 0
for j in range(1,N+1):
    if not(j in treat.keys()):
        counter += 1

print(counter)

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

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

snuke = {}
for i in range(N):
    snuke[i] = 0

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

    for j in range(d):
        snuke[A[j]-1] += 1

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

print(ans)

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

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

print(N-sum(does_have))

Solution (Python):


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


Sunuke_List = [0] * N


for i in range(K):
    d_i = int(input())
    A_i = list(map(int, input().split()))
    for j in range(d_i):
        Sunuke_List[A_i[j]-1] = Sunuke_List[A_i[j]-1] + 1


print(Sunuke_List.count(0))

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

have = [-1]*n

for i in d:
    for j in i:
        

        have[j-1]+=1

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

Solution (Python):
N, K = map(int, input().split())
l = [i+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):
    if A[j] in l:
      l.remove(A[j])
print(len(l))

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

ans = {i + 1 for i in range(N)}
for i in range(K):
    d = int(input())
    A = map(int, input().split())
    for a in A:
        ans.discard(a)

print(len(ans))

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

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

print(sum(p))

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

Solution (Python):
(n,k),*p = [[*map(int, i.split())] for i in open(0)]
a = sum([p[2*i+1] for i in range(k)],[])
print(n - len(set(a)))

Solution (Python):
N, K = map(int, input().split(' '))
input_lists = [input() for _ in range(K*2)]
sweets = []*K
counts = [0]*(N+1)
counts[0] = -1
for i in range(0, len(input_lists), 2):
    tmp = []
    tmp.append(int(input_lists[i]))
    tmp.append(list(map(int, input_lists[i+1].split(' '))))
    sweets.append(tmp)
for sweet in sweets:
    for n in sweet[1]:
        
        counts[n] += 1

print(sum(count == 0 for count in counts))

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

sweet=[0 for i in range(N+1)]

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

for i in range(len(d)):
    for j in range(d[i]):
        sweet[A[i][j]]+=1

num=0
for i in range(1,len(sweet)):
    if sweet[i]==0:
        num+=1
print(num)

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


def main():
    n, k = map(int, readline().rstrip().split())
    nList = [0] * n
    for _ in range(k):
        d = int(readline().rstrip())
        aList = map(int, readline().rstrip().split())
        for a in aList:
            nList[a - 1] += 1
    print(nList.count(0))


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N, K = map(int, input().split())
    ans = [1] * N
    for i in range(K):
        input()
        A = map(int, input().split())
        for Ai in A:
            ans[Ai - 1] = 0
    print(sum(ans))
    return


main()

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


def main():
    n, k, *da = map(int, open(0).read().split())

    is_have_list = set()

    for _ in range(k):
        d = da.pop(0)
        for _ in range(d):
            is_have_list.add(da.pop(0))

    ans = n - len(is_have_list)
    print(ans)
    return(ans)


if __name__ == '__main__':
    main()

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

n_set = set()
for i in range(1,n+1):
    n_set.add(i)

ans = n_set - a_set

print(len(ans))

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

all = list(range(1, n + 1))
kashi = []

for i in range(k):
    x = input()
    kashi.extend(list(map(int, input().split())))
    
diff = set(all) - set(kashi)

print(len(diff))

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

for _ in range(k):
    d = int(input())
    l = list(map(int,input().split()))
    for i in l:
        if i in humans:
            humans.remove(i)
print(len(humans))

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

AList = []
emptyList = []

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

for i in AList:
    for j in range(1, N+1):
        if j in i:
            emptyList.append(j)

print(N-len(list(set(emptyList))))

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

m = [0] * n

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

Solution (Python):

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

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


count = 0
for i in check:
    if i == 0:
        count += 1

print(count)

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

ans=[0]*n

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

ansint=0


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


print(ansint)

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

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

d=[]
syozi=[]
syozi_flag=[0]*N

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

for i in range(K):
    for syozisya in syozi[i]:
        if syozi_flag[syozisya-1]==0:
            syozi_flag[syozisya-1]=1

ans = sum(j==0 for j in syozi_flag)

print(ans)

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

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

Solution (Python):
N, K = map(int, input().split())
A = set()
B = {i for i in range(1,N+1)}
for i in range(K):
    d = int(input())
    C = set(map(int, input().split()))
    A = A | C
print(len(B - A))

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

S = [s for s in range(1, N+1)]
dS = []

for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in A:
        if j in S:
            S.remove(j)
    
print(len(S))

Solution (Python):
N, K = map(int, input().split())
Have = [1]*N
A = []
for k in range(K):
	d = int(input())
	tmp = map(int, input().split())
	for s in tmp:
		if Have[s-1] == 1:
			Have[s-1] = 0

print(sum(Have))

Solution (Python):
n,k = list(map(int, input().split()))
from collections import defaultdict
children = set([])
for i in range(k):
    _ = int(input())
    for j in list(map(int, input().split())):
        children.add(j)
print(n-len(children))

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

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

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

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

for d in data:
    for i in range(d[0]):
        if d[1][i] in person:
            person.remove(d[1][i])
        if person == []:
            print("0", end="")
            exit()
print(len(person), end="")

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

ans = [0]*N
for i in A:
    for j in i:
        ans[j-1]+=1

print(ans.count(0))

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):
n,k=map(int,input().split())
a=[]
for i in range(k):
    d=int(input())
    a.extend(list(map(int,input().split())))
b=set(a)
print(n-len(b))

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


gotsnacks=[]

for i in snukes:
    for j in i:
        if j not in gotsnacks:
            gotsnacks.append(j)

print(N-len(gotsnacks))

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

Solution (Python):
n, k= map(int, input().split())
d=[]
sunukes=[]
for i in range(k):
    d.append(input())
    sunukes = set(sunukes) | set(list(map(int, input().split())))

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

ans = set(allsunuke)- set(sunukes)

print(len(ans))

Solution (Python):
import itertools

num_of_sunuke, num_of_sweetstypes = map(int, input().split())

num_of_havingsweetssunuke= []
havingsweetssunukes = []

for _ in range(num_of_sweetstypes):
    num_of_havingsweetssunuke.append(int(input()))
    havingsweetssunukes.append(list(map(int, input().split())))

set_all = set(range(1, num_of_sunuke + 1))
set_havingsweets = set(itertools.chain.from_iterable(havingsweetssunukes))

print(len(set_all - set_havingsweets))

Solution (Python):
n, k = map(int, input().split())
i = 0
children = set()
while(i < k):
    input()
    children = children | set(map(int, input().split()))
    i += 1
print(n - len(children))

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

ans = [0] * n

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

Solution (Python):
import numpy as np
N, K = map(int, input().split())
snuke = np.zeros(N, dtype=int)
for n in range(K):
    snack = int(input())
    d_snuke = map(int, input().split())
    for d in d_snuke:
        snuke[d-1] = snack
print(N-np.count_nonzero(snuke, axis=0))

Solution (Python):
N, K = map(int, input().split())
snuke = [0] * N
for n in range(K):
    snack = int(input())
    d_snuke = map(int, input().split())
    for d in d_snuke:
        snuke[d-1] = snack
c = 0
for n in range(N):
    if snuke[n] == 0:
        c += 1
print(c)

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

result = [False] * N

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

print(result.count(False))

Solution (Python):
import math
import bisect
from queue import Queue
from collections import deque

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

count = []
for i in range(n+1):
    count.append(0)

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

print(n-sum(count))

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

print(t.count(0))

Solution (Python):
import itertools
N,K=map(int,input().split())
A=[]
for i in range(K*2):
    a=list(map(int,input().split()))
    if i%2==1:
        A.append(a)
x=list(itertools.chain.from_iterable(A))
print(N-len(set(x)))

Solution (Python):
N, K = map(int, input().split())
A = []
for _ in range(K):
    D = int(input())
    A.append(list(map(int, input().split())))
treated_people = len(set(sum(A, [])))
tricked_people = N - treated_people

print(tricked_people)

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

have_number=[]
have_who=[]

for i in range(K):
    i = input().split()
    j = input().split()
    have_number.append(i)
    have_who.append(j)

    
list1=[]
for k in range(1,N+1):
    list1.append(k)
list1


t_have_who=sum(have_who,[])
for c in range(0,len(t_have_who)):
    t_have_who[c]=int(t_have_who[c])
t_have_who  


list1=set(list1)
t_have_who =set( t_have_who )
diff = list1 ^ t_have_who  

print(len(diff))

Solution (Python):
N,K = map(int,input().split())
P = [0] * N
for i in range(K):
    a = int(input())
    b = list(map(int,input().split()))
    for j in range(a):
      P[b[j]-1] = 1 
m = 0   
for i in range(N):
    if P[i] == 0:
        m += 1
print(m)

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

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

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

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

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

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

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

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

Solution (Python):
n,k = map(int,input().split())
su = [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):
        su[a[j]-1] = 1
count = 0
for i in range(n):
    if su[i]==0:
        count+=1
print(count)

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

Solution (Python):
N,K=map(int,input().split())
P= [list(map(int,input().split())) for i in range(2*K)]
count=0
Q=[]
for t in range(1,2*K,2):
    Q.append(P[t])

R=[]
for u in range(0,len(Q)):
    for s in range(0,len(Q[u])):
        R.append(Q[u][s])

for j in range(1,N+1):
    if j not in R:
        count=count+1
    else:
        count=count
print(count)

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

print(counts.count(0))

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

Solution (Python):


(N, K) = map(lambda x: int(x), input().split(' '))
AL = [False for i in range(int(N))]


for i in range(K):
    d = int(input())
    A = [i for i in map(lambda x: int(x) -1, input().split(' '))]
    for i in A:
        AL[i] = True

print(len([1 for x in AL if x==False]))

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

member = [0]*n

for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for j in range(d):
        member[a[j]-1] += 1

print(member.count(0))

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

m = [0] * N

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

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

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

member = [0]*n

for i in range(k):
    d = int(input())
    a = [int(x) for x in input().split()]
    for j in range(d):
        member[a[j]-1] += 1

print(member.count(0))

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


print(len([i for i in a if i < 1]) - 1)

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

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

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

Solution (Python):
def input_int():
    return map(int, input().split())
def one_int():
    return int(input())
def one_str():
    return input()
def many_int():
    return list(map(int, input().split()))



N, K = input_int()

output = []
for i in range(K):
    
    a = many_int()
    
    b = many_int()
    output += b
    
print(N - len(set(output)))

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

def skip():
  input()

def okashi():
  okashi_list = map(int, input().split())
  for i in okashi_list:
    SUNUKE[i] += 1

for i in range(K):
  skip()  
  okashi()
  
print(len([k for k, v in SUNUKE.items() if v == 0]))

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

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

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())))
    
s = set([i for i in range(1, N+1)])
ss =  set()
for i in a:
    ss = ss | set(i)
print(len(s - ss))

Solution (Python):
def input_int():
    return map(int, input().split())

def one_int():
    return int(input())

def one_str():
    return input()

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

N, K = input_int()

sunukes = [i+1 for i in range(N) ]

lis = []
for i in range(K):
    _ = one_int()
    temp = many_int()
    lis += temp

treats = set(sunukes)-set(lis)

print(len(treats))

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

print(N - sum(tmp))

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





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

print(sum(count))

Solution (Python):
N,K = map(int,input().split())
L = 0
s = set() 
for i in range(K):
  d = int(input())
  A = [ int(x) for x in input().split() ]
  for j in range(d):
    s.add(A[j]) 
print(N-len(s))

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

x = N - len(set(lst))
print(x)

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

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

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

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

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

print(ans)

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

Solution (Python):
import collections
N, K = map(int, input().split())
a = set()
for i in range(K):
    d = input()
    a |= set(map(int, input().split()))
print(N - len(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())))

lis = []

for i in A:
    for j in i:
        if j in lis:
            continue
        else:
            lis.append(j)
print(N-len(lis))

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

ans_list=[]
for i in range(Sunuke_num):
    ans_list.append(False)

for i in range(Treat_num):
    s=input("")
    q=input("")
    q=q.split(" ")
    for r in range(int(s)):
        ans_list[int(q[r])-1]=True

print(ans_list.count(False))

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

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

S=[]
for i in range(K):
    S+=A[i]

s=set(S)

total=0
for i in range(1,N+1):
    if (i in s)==False:
        total+=1
print(total)

Solution (Python):



n, k = map(int, input().split())
 
snucks = [0]*n
 
for _ in range(k):
    input()
    for i in map(int, input().split()):
        snucks[i-1] = 1;
 
print(snucks.count(0))

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

snucks = [0]*n

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

print(snucks.count(0))

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

d=[]
U=set(range(1,N+1))
X=set()

for i in range(K):
    d.append(int(input()))

    S=map(int,input().split())
    for s in S:
        X.add(s)

print(len(U-X))

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

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

sunuke = [0]*n

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

print(sunuke.count(0))

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

for i in range(K):
    tmp = int(input())
    tmp_list = list(map(int, input().split()))
    person += tmp_list

print(N-len(set(person)))

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

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

snacks = []
for i in range(k):
    d = int(input())
    snack = list(map(int, input().split()))
    ssnack = []
    for j in range(d):
        ssnack.append(snack[j]-1)
    snacks.append(ssnack)

marks = [1 for i in range(n)] 
for i in snacks:
    for j in i:
        marks[j] = 0


print(str(sum(marks)))

Solution (Python):
n,k = (int(x) for x in input().split())
sunuke = [True] * n
for i in range(k):
    c = int(input())
    ar = [int(x) for x in input().split()]
    for v in ar:
        sunuke[v - 1] = False

ans = 0
for v in sunuke:
    if v == True:
        ans +=1

print(ans)

Solution (Python):
n,k = map(int,input().split())
a=[list(map(int,input().split())) for _ in range(2*k)]
b=[]
for i in range(k):
  b += a[2*i+1]
c=set(b)
print(n-len(c))

Solution (Python):
S = list(map(int,input().split()))
counter = 0
nuske = []

for k in range(S[0]):
  nuske.append(int(0))

for i in range(S[1]):
  roop = int(input())
  if roop == 1:
    temp = int(input())
    nuske[temp-1] = nuske[temp-1] + 1
  else:
    temp = list(map(int,input().split()))
    for l in temp:
      nuske[l-1] = nuske[l-1] + 1

for y in nuske:
  if y == 0:
    counter += 1
print(counter)

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

Solution (Python):
import sys

def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())

n, k = ISI()
l = [1] * n
for i in range(k):
	input()
	a=ILI()
	for j in a:
		l[j-1]=0
print(sum(l))

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

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

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

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

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

Solution (Python):
N,K=map(int,input().split())
arr=[]
ans=[str(i) for  i in range(1,N+1)]
for i in range(K):
    _=input()
    arr.extend((input().split()))
    arr=list(set(arr))
p=0
for n  in  ans:
    if(not(n in arr) ) :
        p=p+1
print(p)

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

C = set(x +1 for x in range(N))
for i in range(K):
    d = int(input())
    A = [int(x) for x in input().split()]
    for x in A:
        if x in C:
            C.remove(x)
print(len(C))

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

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

r = sum(v == 0 for v in pl)
print(r)

Solution (Python):
n, k = map(int, input().split())
all = set(i for i in range(1,n+1))
tr = set()
for _ in range(k):
    d = int(input())
    for i in input().split():
        tr.add(int(i))
sa = all - tr
print(len(sa))

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

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

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

print(d.count(0))