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):
a, b = map(int, input().split())
lis = [0]*a
for i in range(b):
    p = int(input())
    t = map(int, input().split())
    for j in t:
        lis[j-1] = 1
for i in lis:
    a-=i
print(a)

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

Solution (Python):
import itertools
import sys
import numpy as np
input = lambda: sys.stdin.readline().strip()

def main():
    N,K = map(int,input().split())
    itadura = list()
    sunuke_list = [i for i in range(1,N+1)]
    A = list()
    for _ in range(N):
        d = input()
        A.append(map(int,input().split()))
    for ls in A:
        for j in ls:
            itadura.append(j)
    ans = set(sunuke_list) - set(itadura)
    print(len(ans))




main()

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

sunuke = set()
for _ in range(K):
    _ = input()
    A = input().split()
    for a in A:
        sunuke.add(a)

print(N - len(sunuke))

Solution (Python):

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

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


def set_sum(list):
    n = len(list)
    for i in range(n):
        list[i] = set(list[i])
    result = set()
    for i in range(n):
        result = result | list[i]
    return result



print(n - len(set_sum(a)))

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

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

for i in range(K):
    number = int(input())
    menber = [int(x) for x in input().split()]
    for j in range(number):
        snuke[menber[j]-1] += 1

cnt = 0    
for k in range(N):
    if snuke[k] == 0 :
        cnt += 1

print(cnt)

Solution (Python):
n, k = list(map(int, input().split()))
b = {i for i in range(1, n+1)}
a = []
for i in range(k):
    d = int(input())
    z = list(map(int, input().split()))
    for l in z:
        a.append(l)
a_ = set(a)
print(len(b-a_))

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

for _ in range(k):
  d = int(input())
  
  a = list(map(int, input().split()))
  for c in a:
    
    l[c-1] = 0
print(sum(l))

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

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

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

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

print(su.count(0))

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

A=[]
B=[]
for i in range(2*K):
    get=list(map(int,(input().split())))
    if i%2==1:
        A.append(get)
for i in range(len(A)):
    for j in range(len(A[i])):
        B.append(A[i][j])
cnt=0
for i in range(1,N+1):
    if i not in B:
        cnt+=1
        
print(str(cnt))

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

checked = set()

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


unchecked -= checked
print(len(unchecked))

Solution (Python):
n,k=map(int,input().split())
d={}
for i in range(1,n+1):
	d[i]=0
while k:
	k-=1
	x=int(input())
	l=list(map(int,input().split()))
	for i in l:
		d[i]+=1
	
c=0
for i in d:
	if d[i]==0:
		c+=1
print(c)

Solution (Python):
import math
import itertools
cnt = 0
n,k = map(int,input().split())
t = []
for i in range(1,n+1):
    t.append(i)

for i in range(k):
    n = int(input())
    a = list(map(int,input().split()))
    for i in range(len(a)):
        if a[i] in t:
            t.remove(a[i])
        
print(len(t))

Solution (Python):
import numpy as np

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

x = np.array([1 for i in range(N)])
for i in range(0, K*2):
	if i % 2 == 0:
		d = int(input())
	else:
		member = np.array(list(map(int, input().split())))
		for j in range(d):
			x[member-1] = 0

print(np.sum(x == 1))

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

print(N - len(s))

Solution (Python):

N, K = map(int, input().split())
okasi = [False for _ in range(N)]

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

print(N - sum(okasi))

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

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

for i in range(n):
    if sunuke.count(i+1) == 0:
        count += 1

print(count)

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

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

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

if __name__ =='__main__':
    main()

Solution (Python):

N, K = map(int, input().split())
Result = [True] * N
Count = 0
for i in range(K):
    d = int(input())
    A = input().split()
    for j in range(len(A)):
        Result[int(A[j])-1] = False

Count = Result.count(True)
print(Count)

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

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

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

print(count)

Solution (Python):
N, K = map(int,input().split())
sweet = [list(map(int,input().split())) for s in range(K*2)]
tmp = []
for index,s in enumerate(sweet):
	if index % 2 != 0:
		if len(s) >= 2:
			for ss in s:
				tmp.append(ss)
		else:
			tmp.append(*s)
print(N - len(set(tmp)))

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

lis_d = [];
lis_A = [];

for i in range(k):
    d = int(input());
    A = list(map(int, input().split()));
    lis_d.append(d);
    lis_A.append(A);

all_A = []
for a in lis_A:
    all_A += a;

all_A = set(all_A)

all_num = set(range(1, n + 1));

ans = len(list(all_num - all_A));
print(ans)

Solution (Python):
n,k=map(int,input().split())
seta=set()
for i in range(k):
    d=int(input())
    l=[int(i) for i in input().split()]
    for j in l:
        seta.add(j)

print(n-len(set(seta)))

Solution (Python):
N,K=map(int,input().split())
hito=[num for num in range(1,N+1)]
for i in range(K):
  d=int(input())
  A=list(map(int,input().split()))
  for a in A:
    if a in hito:
      hito.remove(a)
print(len(hito))

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


def main():
    n, k = input_list()
    a = set()
    c = k*2
    for i in range(c):
        num = input()
        d = input_list()
        for v in d:
            a.add(v)
    print(n-len(a))


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


if __name__ == '__main__':
    main()

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

  a = list(map(int, l[2*i +1].split()))
  for j in a:
    sunuke_l[j-1] = 1
print(n -sum(sunuke_l))

Solution (Python):
N, K = [int(i) for i in input().split()]
sunuke = [False] * N

for i in range(K):
    d = int(input())
    target_list = list(input().split())
    for k in target_list:
        sunuke[int(k)-1] = True
    

print(N-sum(sunuke))

Solution (Python):
n,k = map(int,input().split())
ans=[]
s=[list(map(int, input().split())) for _ in range(0,2*k)]
for i in s[1::2]:
    for j in i:
        ans.append(j)
print(n-len((set(ans))))

Solution (Python):
import queue
import copy
import math
from collections import deque
import bisect
from decimal import Decimal


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

s = set()


for i in range(0, 2 * k):
    if i % 2 == 0:
        d = int(input())
        continue
    l = input().split()
    for v in l:
        s.add(v)

print(n-len(s))

Solution (Python):

def main():
    N,K = map(int, input().split())
    cnt = 0
    sunuke = [0]*(N+1)

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

    
    cnt = sunuke.count(0) - 1

    print(cnt)




if __name__ == '__main__':
    main()

Solution (Python):
import itertools
N, K = map(int, input().split())
all_sunuke = []
for _ in range(K):
    d = int(input())
    *A, = map(int, input().split())
    all_sunuke.append(tuple(A))
all_sunuke = list(itertools.chain.from_iterable(all_sunuke))
print(N - len(set(all_sunuke)))

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

Solution (Python):
import sys
import math

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

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

print(N - len(set(ALL)))

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 i in A:
        ans[i-1]=1

print(len([i for i in ans if i%2==0]))

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

for i in range(m):
    l = int(input())
    ll = list(map(int,input().split()))

    for ii in range(l):
        ls.append(ll[ii])

ls = set(ls)

c = 0
for i in range(1,n+1):
    if not i in ls:
        c+=1

print(c)

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

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

for i in range(len(d)):
    if i % 2 == 0:
        continue
    else:
        for j in range(len(d[i])):
            if d[i][j] in s:
                s.remove(d[i][j])
      
            
print(len(s))

Solution (Python):
def main():
    N, K = map(int, input().split())
    D = []
    A = []
    for i in range(K):
        d = int(input())
        Ai = [int(x) for x in input().split()]
        A = A + Ai
    A_ = set(A)
    n = N - len(A_)
    print(n)
main()

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

for i in range(K):
    C=A[i]
    for j in C:
        o[j-1]=1
c=0
for i in o:
    if i==0:
        c+=1

print(c)

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

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

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

print(ans)

Solution (Python):
import numpy as np

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

A = np.zeros(N, dtype=int)

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

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

Solution (Python):
N,K= map(int,input().split())
rich_boy = set()
all_boy = set([n for n in range(1,N+1)])
for k in range(K):
    d = input()
    A = set(map(int,input().split()))
    rich_boy=rich_boy.union(A)
print(len(all_boy-rich_boy))

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

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

ans=[0]*N



for i in range(K):
  d=int(input())
  A=[int(_) for _ in input().split(" ")] 
  
  for j in range(d):
    ans[A[j]-1] += 1


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

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

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

n = 0
for sunu in sunuke:
    if sunu == 0:
        n += 1
print(n)

Solution (Python):
n,k = map(int,input(). split())
allist = []
for i in range(k):
  d = input()
  a = input().split(" ")
  linta = [int(n) for n in a]
  allist.extend(linta)
alist = set(allist)
kotae = n-len(alist)
print(kotae)

Solution (Python):
arr_1 = input().split(" ")

n=int(arr_1[0])
k=int(arr_1[1])

okashimochi=list()

for num in range(0,k):
    input()
    child = list(input().split(" "))
    okashimochi.extend(child)

result = list(set(okashimochi))
print(n-len(result))

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

for i in range(K):
  a = input()
  case = case + list(map(int, input().split()))
  
cases = set(case)
print(N-len(cases))

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

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

print(sunuke.shape[0] - np.count_nonzero(sunuke))

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

for i in range(k):
    num = int(input())
    a = map(int, input().rstrip().split())
    for j in a:
        a_set.add(j)

print(n-len(a_set))

Solution (Python):
from sys import stdin

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

A_list = [0 for i in range(N)]

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

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

print(count)

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

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

print(len(set(A)^set(N)))

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

li = []

for i in range(1, k+1):
  d = int(input())
  a = list(map(int, input().split()))
  li.extend(a)

newli = set(li)

count = 0

for j in range(1, n+1):
  if j in newli:
    count = count
  else:
    count = count + 1

print(count)

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

check = []

for i in range(1, k+1):
  check.extend(d[i*2-1])

print(n-len(set(check)))

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

for m in nusuke:
    if m==0:
        ans += 1
print(ans)

Solution (Python):
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,k=mis()
    nlis=[0 for _ in range(n+1)]
    for _ in range(k):
        d=ii()
        a=input().split()
        for i in range(d):
            x=int(a[i])
            nlis[x]+=1
    cnt=0
    for i in range(1,n+1):
        if nlis[i]==0: cnt+=1
    print(cnt)



if __name__ == "__main__":
    main()

Solution (Python):
n,k = map(int,input().split())
lis = [[int(p) for p in input().split()] for _ in range(2*k)]
people = [0]*n

for i in range(k):
  
  for j in range(lis[2*i][0]):
    print()
    num = lis[2*i+1][j]
    people[num-1] = 1

count = 0
for i in people:
  if i == 0:
    count += 1
    
print(count)

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

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


for a in A:
    for j in a:
        if sunu[j] == 0:
            ans -= 1
            sunu[j] += 1

print(ans)

Solution (Python):


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

if __name__ == '__main__':
    main()

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

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

Solution (Python):

N, K = map(int, input().split())
snukes = set([i+1 for i in range(N)])
d = []
for k in range(K):
    input()
    for a in map(int, input().split()):
        if a in snukes:
            snukes.remove(a)
print(len(snukes))

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


B=[0 for i in range(N)]

for j in A:
  for k in j:
    B[k-1]+=1
C=B.count(0)

print(C)

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

for i in range(k):
    tmp = int(input())
    tmp2 = list(input().split())
    d.append(tmp)
    A.append(tmp2)
    
for i in range(k):
    for j in range(d[i]):
        if A[i][j] not in cnt:
            cnt.append(A[i][j])

ans = n - len(cnt)
print(ans)

Solution (Python):


s = list(map(int, input().split(" ")))

snk = s[0]
oks = s[1]

v = []
for i in range(oks) :
    num = int(input())
    x = list(map(int, input().split(" ")))
    for j in range(num) :
        v.append(x[j])

ans = snk - len(set(v))

print(ans)

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

c=[]
b=[list(map(int, input().split())) for i in range(2*k)]

for i in range(1,2*k,2):
  for j in range(len(b[i])):
    c.append(b[i][j]) 

d=set(c)
print(n-len(d))

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

print(ans)

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

for i in range(K):
    X = int(input())
    arr = list(map(int, input().split()))
    for j in range(len(arr)):
        morata[arr[j]-1] = 1

print(morata.count(0))

Solution (Python):
import itertools

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

grid = []
for i in range(K*2):
    array = list(map(int, input().strip().split()))
    grid.append(array)

grid2 = []

for j in range(K):
    grid2.append(grid[j*2+1])

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

for k in range(1, N+1):
    if k in grid2:
        pass
    else:
        X += 1

print(X)

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

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

print(len(N_list))

Solution (Python):
N, K = [eval(v) for v in input().strip().split(" ")]
Snuke = [0] * N
for i in range(K):
    d = eval(input())
    A = [eval(v) for v in input().strip().split(" ")]
    for a in A:
        Snuke[a-1] += 1

victim_num = 0
for i in range(len(Snuke)):
    if Snuke[i] == 0:
        victim_num += 1
print(victim_num)

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

d = []
A = []
for i in range(K):
    _d = int(input())
    d.append(_d)
    _a = [int(x) for x in input().split()]
    A.append(_a)

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

for a in A:
    for _a in a:
        if _a in res:
            res.remove(_a)
print(len(res))

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

def resolve():
    import itertools
    n,k=map(int, input().split())
    l=[list(map(int,input().split())) for i in range(2*k)]
    newl=l[1::2]
    newl=itertools.chain(*newl)
    print(n-len(set(newl)))
resolve()

Solution (Python):
n, k = map(int, input().split(" "))
d = []
A_list = []
for ki in range(k):
    d = int(input())
    A = map(int, input().split(" "))
    A_list.extend(A)

ari = len(set(A_list))
print(n - ari)

Solution (Python):

import sys
import itertools



def main():
    N, K = [int(x) for x in input().split()]
    d = []
    A = []
    for i in range(K):
        d.append(input())
        A.append(input().split())
    a = list(set(itertools.chain.from_iterable([list(set(x)) for x in A])))
    print(N - len(a))
    return

if __name__ == '__main__':
    main()

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

n = []
for i in range(K * 2):
    _in = input().split()
    if i % 2 != 0:
        n = n + _in

print(N - len(set(n)))

Solution (Python):

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

sweets = [0] * N

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

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

Solution (Python):
n,k=map(int,input().split())
nlst = [0]*n
total = 0
for i in range(k):
    d = int(input())
    List = [int(i) for i in input().split()]
    for num in List:
        nlst[num-1] += 1
for ans in nlst:
    if ans == 0:
        total += 1
print(total)

Solution (Python):

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

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

counter = 0
for i in range(N):
  if((i+1 in A_list_list) ==True):
    counter = counter
  else:
    counter = counter + 1
print(counter)

Solution (Python):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
n,k=map(int,input().split())

l=[0]*n

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

Solution (Python):
if __name__ == '__main__':
    N, K = map(int, input().split())

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

    print(sunuke.count(False))

Solution (Python):
def resolve():
    '''
    code here
    '''
    N, K = [int(item) for item in input().split()]
    
    data = [input() for _ in range(2*K)]

    sunuke = [0 for _ in range(N)]

    for i in range(K):
        d = data[i*2]
        okashi = data[i*2 + 1].split()
        for j in okashi:
            sunuke[int(j)-1] += 1


    cnt = 0
    for k in sunuke:
        if k == 0:
            cnt += 1

    print(cnt)

if __name__ == "__main__":
    resolve()

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

for i in A:
    for j in i:
        B.append(j)
print(N-len(set(B)))

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

print(x.count(0))

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()
aa = [[]for _ in range(k)]
for i in range(k):
    d = ii()
    aa[i] = li()

dp = [0]*(n+1)
dp[0] = 1
for i in range(k):
    for l in aa[i]:
        dp[l] = 1
ans = 0
for i in range(n+1):
    if dp[i] == 0:
        ans += 1
print(ans)

Solution (Python):
input_NK = input().split(' ')
N = int(input_NK[0])
K = int(input_NK[1])
rest = [i + 1 for i in range(N)]

for i in range(K):
  di = int(input())
  input_Ai = input().split(' ')
  for j in range(len(input_Ai)):
    if rest.count(int(input_Ai[j])) != 0:
      rest.remove(int(input_Ai[j]))
    
print(len(rest))

Solution (Python):

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

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

for i in range(k):
    d = int(input())
    has_sunuke_list = input().split()
    for k in has_sunuke_list:
        sunuke_list[int(k)-1] = True

print(sunuke_list.count(False))

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

a_set = set(a[0])
for i in a:
    a_set = a_set | set(i)

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

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

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

for n in range(K):
  for a in A[n]:
    counts[a-1] +=1

print(counts.count(0))

Solution (Python):
N,K = map(int,input().split()) 
sunuke = list(range(1,N+1))
for i in range(K):
    d = int(input())
    s = list(map(int,input().split()))
    for j in s:
        if j in sunuke:
            sunuke.remove(j)
print(len(sunuke))

Solution (Python):
import sys
from math import floor,ceil,sqrt,factorial,log
from heapq import heapify, heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from decimal import Decimal
inf = float('inf')
MOD = 1000000007

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


s = [0 for _ in range(n)]

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

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

print(ans)

Solution (Python):
_=list(map(int,input().split()))
N=_[0];K=_[1]
D=[]
A=set()
for k in range(K):
    D.append(int(input()))
    a=list(map(int,input().split()))
    for i in a:
        A.add(i)
print(N-len(A))

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

sunukes = [0] * N

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


print(sunukes.count(0))

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

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

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

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

for j in range(1, n+1):
    TF.append(j in a_list)

print(TF.count(False))

Solution (Python):
N,K = list(map(int,input().split()))
d=[]
A = []
sunuke = set()
for i in range(K):
    d_i = int(input())
    A_i = list(map(int,input().split()))
    for j in A_i:
        sunuke.add(j)


print(N-len(sunuke))

Solution (Python):
from math import gcd
from functools import reduce
from itertools import product

def resolve():
  N, K = map(int, input().split(" "))

  a = []
  for k in range(K):
    d = int(input())
    a.extend([int(x) for x in input().split(" ")])

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

if __name__ == "__main__":
    resolve()

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

Solution (Python):
def input_from_console():
    n, k = map(int, input().split())
    a_list = []
    for i in range(k):
        d = input().rstrip()
        a = map(int, input().rstrip().split())
        for ii in a:
            if not ii in a_list:
                a_list.append(ii)
    return n, a_list


def solve(n, a_list):
    
    return n - len(a_list)


def main():
    n, a_list = input_from_console()
    print(solve(n, a_list))

if __name__ == "__main__":
    import sys

    if sys.gettrace():  
        check_cases()
    else:
        main()

Solution (Python):
import numpy as np

N,K = (int(x) for x in input().split())
x = np.zeros(N)
count = 0

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

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

print(count)

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())))            
dp = [0]*(N+1)
for i in range(K):
    for j in range(d[i]):
        dp[A[i][j]] = 1
print(N-sum(dp))

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

Solution (Python):


def main():
    n, k = map(int, input().split())
    nset = set()
    for i in range(k):
        d = int(input())
        have = list(map(int, input().split()))
        have_set = set(have)
        nset |= have_set

    ans = n - len(nset)

    print(ans)

main()

Solution (Python):
n, k = map(int, input().split())
s = []
num = 0
for i in range(k):
    d = int(input())
    lists = list(map(int, input().split()))
    for j in range(d):
        s.append(lists[j])
for i in range(n):
    if i+1 not in s:
        num += 1
print(num)

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

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

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

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

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


mans = [0]*n
for _ in range(k):
    how = int(input())
    man = list(map(int, input().split()))
    for i in man:
        mans[i-1] += 1

print(mans.count(0))