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):
import numpy as np
N, K = map(int, input().split())
member = np.ones(N, dtype=int)
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for j in range(len(A)):
        member[A[j]-1] = 0
print(sum(member))

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

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

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

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

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

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

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

for i in range(K):
    d = int(input())
    A_list = [int(e) for e in input().split()]
    for sunuke in A_list:
        sunuke_list[sunuke] += 1

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

print(ans)

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

flag = [True for _ in range(N + 1)]
flag[0] = False

for _ in range(K):
    _ = input()
    for a in map(int, input().split()):
        flag[a] = False

print(sum(flag))

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

people = [1] * n

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

print(sum(people))

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

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

for u in  list:
    if u == 0:
        ans += 1
        
print(ans)

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

sunuke = [False] * N

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

print([x for x in sunuke if not x].__len__())

Solution (Python):
import collections

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

snacks = collections.defaultdict(int)

for k in range(0, K):
  d = int(input())
  for n in input().split():
    snacks[int(n)] += 1
    
count = 0
for n in range(1, N + 1): 
  if snacks[n] == 0:
    count += 1
   
print(count)

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):
n = [int(e) for e in input().split(" ")]
d = [False] * n[0]
for i in range(n[1] * 2):
    raw = [int(e) for e in input().split(" ")]
    if((i+1) % 2 == 0):
        for e_r in raw:
            d[e_r - 1] = True
    else:
        pass
else:
    print(d.count(False))

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

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

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



if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())
D = [0 for _ in range(N)]
for _ in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for i in range(d):
        D[A[i] - 1] += 1
res = 0
for i in range(N):
    if not D[i]:
        res += 1
print(res)

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

s = []

for i in range(N):
    s.append(False)
    
for i in range(K):
    d = int(input())
    a = list(map(int,input().split()))
    for j in range(d):
        s[a[j]-1] = True
        
cut = 0
for i in range(N):
    if not s[i]:
        cut += 1

print(cut)

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

Solution (Python):
A = []
sweetsInfo = [0]*100
empty = 0

N,K = input().split()

for i in range(int(K)):
    d = int(input())
    A = input().split()
    for o in range(d):
        sweetsInfo[int(A[o]) - 1] = 1

for i in range(int(N)):
    if sweetsInfo[i] == 0:
        empty += 1

print(empty)

Solution (Python):
A = []
sweetsInfo = [0]*100
empty = 0

N,K = input().split()

for i in range(int(K)):
    d = int(input())
    A = input().split()
    for o in range(d):
        sweetsInfo[int(A[o]) - 1] = 1

for i in range(int(N)):
    if sweetsInfo[i] == 0:
        empty += 1

print(empty)

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

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

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

Solution (Python):
NK = list(map(int,input().split()))
A = []
c = 0
for i in range(NK[1]):
    dk = int(input())
    Aid = list(map(int,input().split()))
    for k in Aid:
        A += [k]
for i in range(1,NK[0]+1):
    if not i in A:
        c += 1
print(c)

Solution (Python):
N, K = map(int, input().split())
set_all = set()
for i in range(K):
    d = int(input())
    
    
    li = map(int, input().split())
    set_li = set(li)
    
    set_all = set_all | set_li

s = {i for i in range(1,N+1,1)}
s_xor = s ^ set_all
print (len(s_xor))

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

a = [0] * n
for w in range(k):
    d = int(input())
    ds = list(map(lambda x:int(x),input().split()))
    for i in ds:
        a[i-1] = 1

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

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

data = [list(map(int, input().split())) for _ in range(int(2 * K))]

Sunuke = [0] * N

for i in range(K):
    for j in range(data[int(2 * i)][0]):
        Sunuke[data[int(2 * i + 1)][j] - 1] += 1


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

print(count)

Solution (Python):
n,k=map(int,input().split())
lists=[]
for _ in range(k):
  d=int(input())
  a=list(map(int,input().split()))
  lists.append(a)
num=[0]*n
for list in lists:
  for __ in range(len(list)):
    num[list[__]-1]+=1
count=0
for nn in num:
  if nn==0:
    count+=1
print(count)

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

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

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

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

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

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

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

print(snukes.count(0))

Solution (Python):

import sys


def main():
    N, K = map(int, sys.stdin.readline().strip().split())
    people = [False for _x in range(N)]
    for i in range(K):
        _ = sys.stdin.readline()
        for k in map(int, sys.stdin.readline().strip().split()):
            people[k-1] = True

    print(sum([1 for i in people if i is False]))


if __name__ == '__main__':
    main()

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

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

print(snukes.count(0))

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

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

s = []
for i in range(n):
    s.append(False)

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

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

print(cnt)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
mod2 = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    s = set()
    for _ in range(k):
        d = I()
        s |= set(LI())

    return n - len(s)


print(main())

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

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

sunuke=[0]*n

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

print(sunuke.count(0))

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

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

Solution (Python):
n,k = [int(_) for _ in input().split()]
mark = [0]*n
for t in range(k):
  m = int(input())
  arr = [int(x) for x in input().split()]
  for i in arr:
    mark[i-1] = 1
print(n-sum(mark))

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

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

ct = [0]*n

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

print(n-sum(ct))

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

Solution (Python):
N, K = map(int, input().split())
q = set([])
for _ in range(K):
    tmp = int(input())
    A = list(map(int, input().split()))
    for a in A:
        q.add(a)

print(N - len(q))

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    N, K = read_ints()
    has_snacks = [False]*N
    for _ in range(K):
        _ = read_int()
        A = read_ints()
        for a in A:
            has_snacks[a-1] = True
    return has_snacks.count(False)


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

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

Solution (Python):
















N,K = map(int,input().split())
Nset = set(list(range(1,N+1)))
okasi = []
shojisha = []
for _ in range(K):
    okasi.append(int(input()))
    shojisha.append(list(map(int,input().split())))

for lis in shojisha:
    Nset = Nset - set(lis)

print(len(Nset))

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

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

sunuke = [0] * n

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

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

print(ans)

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

print(n-len(set(A)))

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

b = [False for _ in range(n)]

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

for bb in b:
    if(bb == False):
        ans += 1
        
print(ans)

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

A = [0] * n

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

Solution (Python):
n,k = map(int,input().split())
li1 = []
li2 = [0]*n
for i in range(n):
    li2[i] = i+1
for i in range(k):
    a = input()
    b = [int(j) for j in input().split()]
    for j in range(len(b)):
        li1.append(b[j])
print(len(set(li1) ^ set(li2)))

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

lst = [0] * N

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

print(lst.count(0))

Solution (Python):
a = 1;
treat = 0;
n, k = map(int, input().split());

data = [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())
flag = [True]*N
for i in range(K):
    d = int(input())
    A = list(map(int, input().split()))
    for a in A:
        flag[a-1] = False
ans = 0
for i in range(N):
    if flag[i]:
        ans += 1
print(ans)

Solution (Python):




def main():
    n, k = map(int, input().split())
    aset = set()
    for _ in range(k):
        d = int(input())
        a = set(map(int, input().split()))
        aset = aset.union(a)
    print(n - len(aset))


if __name__ == "__main__":
    main()

Solution (Python):
[N, K] = [int(x) for x in input().split()]
d = []
A = []
for i in range(K):
	d.append(int(input()))
	A.append([int(x) for x in input().split()])
loop = 0
count = 0
for i in range(N):
	bool = 0
	for j in range(K):
		for k in range(d[j]):
			if A[j][k] == i+1:
				bool = 1

	if bool == 0:
		count = count + 1
print(count)

Solution (Python):
def main():
    N,K = [int(x) for x in input().split()]
    snack_sunuke = []
    for a in range(K):
        di = int(input())
        for i in [int(x) for x in input().split()]:
            snack_sunuke.append(i)
    print(N - len(set(snack_sunuke)))

if __name__ == '__main__':
    main()

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

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

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

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

        sunuke[a] = 1
print(N - sunuke.count(1))

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

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

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

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

xs = [0] * N
for rs in A:
    for r in rs:
        xs[r - 1] += 1

result = sum(x == 0 for x in xs)

print(result)

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

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

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

A = np.zeros((int(k), int(n)))
for i in range(int(k)):
    _ = input()
    for j in input().split(" "):
        A[i-1,int(j)-1] = 1
print(np.sum((np.sum(A, axis=0) == 0)))

Solution (Python):
a,b = map(int,input().split())
ans_li = [0 for x in range(a)]

for i in range(b):
  d = int(input())
  l = list(map(int, input().split()))
  for ll in l:
      ans_li[ll-1] += 1
print(ans_li.count(0))

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

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

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 a:    
        ans[j-1]=1 

print(n-sum(ans))

Solution (Python):
def main():
    ans = 0
    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
    for i in range(n):
        if l[i] == 0:
            ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
li = []
for i in range(k):
  d = int(input())
  sunuke = input().split()
  for j in range(d):
    if int(sunuke[j]) not in li:
      li.append(int(sunuke[j]))
print(str(n - len(li)))

Solution (Python):
co = list(map(int,input().split()))
N = co[0]
K = co[1]
sunuke = [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):
        sunuke[A[j]-1] +=1
ans = 0      
for i in range(N):
    if sunuke[i] == 0:
          ans += 1
print(ans)

Solution (Python):
N, K = map(int, input().split())
S = []
for i in range(K):
    d = input()
    for j in input().split():
        if j not in S:
            S.append(j)

print(N - len(S))

Solution (Python):



N, K = map(int, input().split())
dummy, ans = 0, 0
array, sarray = [], []
for i in range(K):
    dummy = int(input())
    array += list(map(int, input().split()))
sarray = set(array)

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

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())))
    
aa=[0]*N
counts=0


for k in a:
    for j in k:
        aa[j-1]+=1
        
for x in aa:
    if x==0:
        counts+=1

print(counts)

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())))
    
aa=[0]*N
counts=0

for k in a:
    for j in k:
        aa[j-1]+=1
        
for x in aa:
    if x==0:
        counts+=1

print(counts)

Solution (Python):
N,K = map(int,input().split())
D = []
A = []
for k in range(K):
    D.append(int(input()))
    A.append([int(i) for i in input().split()])
P = [True for i in range(N)]
for a in A:
    for aa in a:
        P[aa-1] = False
print(sum(P))

Solution (Python):
n,k = map(int,input().split())
a = list(input() for nesya in range(2*k))
t = 1
b =[]
for hoge in a:
  if t%2 == 0:
    b += list(hoge.split())
  t += 1
c = set(b)
ans = n - len(c)
print(ans)

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

snuke = [0]*N
for AA in A:
    for a in AA:
        snuke[a-1]+=1

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

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

for i in range(k):
  dummy = int(input())
  ans = map(int, input().split())
  list.extend(ans)

print(n - len(set(list)))

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

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

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

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

Solution (Python):
import numpy

N, K = map(int,input().split()) 
P = [list(map(int, input().split())) for i in range(2 * K)]
flatten = lambda x: [z for y in x for z in (flatten(y) if hasattr(y, '__iter__') else (y,))]

print(N - len(set(flatten(P[1::2]))))

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

print(n - len(set(count)))

Solution (Python):


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

sunuke = [1] * N

for i in range(K):
    di = int(input())
    tmp = map(int, input().split())
    for t in tmp:
        sunuke[t-1] = 0
print(sum(sunuke))

Solution (Python):


inp = input().split(' ')
N, K = int(inp[0]), int(inp[1])

sunuke = [1] * N

for i in range(K):
    di = int(input())
    tmp = map(int, input().split())
    for t in tmp:
        sunuke[t-1] = 0
print(sum(sunuke))

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

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

print(sunuke.count(0))

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

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

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

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

Solution (Python):
import sys
def main():
    
    num_list = list(map(int, input().split()))
    N = num_list[0]
    K = num_list[1]

    
    list1 = [int(s) for s in range(1,N+1,1)]

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

        for i in listA:
            
            if i in list1: list1.remove(i)

    print(len(list1))

main()

Solution (Python):
N, K = [int(n) for n in input().split(' ')]
dic = {}
for i in range(1, N+1):
  dic[i] = 0
for i in range(K):
  d = int(input())
  A = [int(n) for n in input().split(' ')]
  for j in A:
    dic[j] += 1

ans = 0

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

print(ans)

Solution (Python):
def B():
    n, k = list(map(int, input().split()))
    a = []
    for i in range(2*k):
        ipt = input()
        if i%2==1:
            a += list(map(int, ipt.split()))
    a = set(a)
    res = set(range(1, n+1)) - a 
    print(len(res))
B()

Solution (Python):

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



dic={}

for i in range(k):
    d=int(input())
    al=list(map(int,input().split()))
    for a in al:
        dic[a]=True
ans=0
for i in range(1,n+1):
    if dic.get(i,0)==0:
        ans+=1
print(ans)

Solution (Python):
import numpy as np

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

cnt = np.array(list([0]*n))

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

print(np.count_nonzero(cnt==0))

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())))
s = [0] * n
for ai in a:
    for i in range(len(ai)):
        s[ai[i] - 1] += 1
ans = 0
for si in s:
    if si == 0:
        ans += 1
print(ans)

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

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

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

ans = set()
for _ in range(K):
    input()
    s = set(map(int, input().split()))
    ans |= s

print(N-len(ans))

Solution (Python):
whatMan = []

N, K = input().split()
for i in range(int(K)):
    input()
    whatMan.extend(input().split())
print(int(N) - len(set(whatMan)))

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

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

	d.append(int(input()))
	a.extend(list(map(int,input().split())))
x=0    
for s in range(1,n+1):
	if s not in a:
		x+=1
        
print(x)

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

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

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

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

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

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

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

import collections
import itertools


data = list(itertools.chain.from_iterable(data))

data = list(set(data))

print(n - len(data))

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

ANSlist = []
ANS = 0

for i in range(K):
    I = input() 
    S = input().split()
    
    for j in range(len(S)):
        if S[j] != " ":
            
            if not S[j] in ANSlist:
                ANSlist.append(S[j])
                
            


'''for i in range(len(ANSlist)):
    if ANSlist[i] != 0:
        ANS += 1'''
ANS = N - len(ANSlist)
print(ANS)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import itertools
    n,k=map(int, input().split())
    sunukel=[False]*n
    for i in range(k):
        d=int(input())
        l=list(map(int, input().split()))
        for j in l:
            if sunukel[j-1]==False:
                sunukel[j-1]=True
    print(n-sum(sunukel))
resolve()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    import itertools
    n,k=map(int, input().split())
    sunukel=[0]*n
    for i in range(k):
        d=int(input())
        l=list(map(int, input().split()))
        for j in l:
            sunukel[j-1]+=1
    print(sunukel.count(0))
resolve()

Solution (Python):
N,K=[int(s) for s in input().split()]
snuke=[0 for _ in range(N)]
for i in range(K):
  a=int(input())
  ls=[int(s) for s in input().split()]
  for e in ls:
    snuke[e-1]+=1
ans=0
for e in snuke:
  if e==0:
    ans+=1
print(ans)

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

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

arr=[]
arr1=[]
for i in range(1, N+1):
  arr1.append(i)

for i in range(K):
  d=input()
  A=list(map(int, input().split()))
  arr = arr+A
print(len(set(arr1) - set(arr)))

Solution (Python):
import sys
     
n, k = map(int, sys.stdin.readline().split())
     
snukes = [1] * n
     
for _ in range(k):
  n = int(sys.stdin.readline())
  nums = list(map(int, sys.stdin.readline().split()))
  for num in nums:
    snukes[num - 1] = 0

print(sum(snukes))

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

ans = [L for L in Su if len(L) == 0]
ans = len(ans)
print(ans)

Solution (Python):
def solve():
    n,k=map(int,input().split())
    A=[0 for i in range(n)]
    for i in range(k):
        d=int(input())
        di=list(map(int,input().split()))
        for ele in di:
            A[ele-1]+=1
    count=0
    for i in range(n):
        if(A[i]==0):
            count+=1
    print(count)
solve()

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

okashi = {}
for i in range(k):
    d = int(input())
    a_list = input().split()
    for a in a_list:
        if not a in okashi:
            okashi[a] = True

print(n - len(okashi))