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



Sample input:
3 2
2
1 3
1
3


Sample output:
1

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
P = [0 for i in range(N)]
for i in range(K):
  a = int(input())
  b = list(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

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split())
 
P = [0 for i in range(N)]
for i in range(K):
  a = int(input())
  b = list(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)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
y = 0
#すぬけくんを生成する
sunuke=[]
for i in range(1,n):
  sunuke.append(i)

#入力させる
for j in range(1,k):
  ka = input()
  for l in range(ka):
    x = input()
    sunuke[x - 1] = -1

#数える
for m in range(0,n-1):
  if sunuke[m] != -1:
    y += 1
    
print(y)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
y = 0
#すぬけくんを生成する
sunuke=[]
for i range(1,n):
  sunuke.append(i)

#入力させる
for j range(1,k):
  ka = input()
  for l range(ka):
    x = input()
    sunuke[x - 1] = -1

#数える
for m range(0,n-1):
  if sunuke[m] != -1:
    y += 1
    
print(y)

Submission status: Runtime Error

Solution code:
N, K = input().split(" ")
sweets = [[0 for i in range(int(N))] for j in range(int(K))]
ans = 0

for i in range(int(K)):
  d = input()
  have = input().split(" ")
  for s in have:
    sweets[i][int(s)] += 1

for sunuke in sweets:
  tmp = sum(sunuke)
  if(not tmp):
    ans += 1

print(ans)

Submission status: Runtime Error

Solution code:
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>

using namespace std;


void solve() {
    int N, K; cin >> N >> K;

    vector<bool> judge(N, true);

    for (int i = 0; i < K; i++) {
        int d; cin >> d;
        for (int j = 0; j < d; j++) {
            int a; cin >> a; a--;
            judge[a] = false;
        }
    }

    int ans = accumulate(judge.begin(), judge.end(), 0);
    
    cout << ans << endl;
}   


int main() {
    solve();
    return 0;
}

Submission status: Runtime Error

Solution code:
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())
  for j in range(roop):
    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)

Submission status: Runtime Error

Solution code:
[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)))

Submission status: Runtime Error

Solution code:
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))

Submission status: Runtime Error

Solution code:
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(!(n in arr) ) :
        p=p+1
print(p)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
x=[0]*n
for i in range(k):
    y=int(input())
    z=list(map(int,input().split()))
    for j in z:
        x[j-1] +=1
a=0
for b in x:
    if b==0:
        c+=1
print(c)

Submission status: Runtime Error

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

S = [1] * N 

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

Submission status: Runtime Error

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

#お菓子を持っていない : 1
#お菓子を持っている   : 0
#持っていない人を最終的に導くから
S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in range(t):
        #i-1なのは添字と要素tが1ぶんずれているから
        S[i-1] = 1
print(sum(S))

Submission status: Runtime Error

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

#お菓子を持っていない : 1
#お菓子を持っている   : 0
#持っていない人を最終的に導くから
S = [1] * N 

for i in range(K):
    d = int(input())
    t = map(int, input().split())
    for i in range(t):
        #i-1なのは添字と要素tが1ぶんずれているから
        S[i-1] = 1
print(sum(S))

Submission status: Runtime Error

Solution code:
 = [int(x) for x in input().split(' ')]
 
def solve(n, k):
    snukes = [None] * n
    victims = 0
 
    for i in range(k):
        snacks = int(input())
        snukes_snacks = [int(z) for z in input().split(' ')]
        for j in range(snacks):
            snukes[j-1] = snukes_snacks[j-1]
 
    for w in range(n):
        if snukes[w] is None:
            victims += 1
    
    print(victims)
 
solve(n, k)

Submission status: Runtime Error

Solution code:
import itertools^M
N,K = list(map(int, input().split(" ")))^M
A = list(itertools.chain.from_iterable([input().split(" ")  for i in range(K) if input().split(" ")]))^M
A = list(map(int, A))
none = [a for a in range(1, K + 1) if a not in A]
print(len(none))

Submission status: Runtime Error

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

check = [0] * N

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

print(sum(1 for x in check if x == 0))

Submission status: Runtime Error

Solution code:
3 3
1
3
1
3
1
3

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split(' '))
a=list(1 for i in range(n+1))
for z in range(k):
  x=int(input())
  temp=map(int,input.split(' '))
  for i in temp:
    a[i]+=1
    c=0
for i in range(1,n+1):
  if(a[i]==0):
    c++
print(c)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split(' '))
a=list(1 for i in range(n+1))
for z in range(k):
  x=int(input())
  temp=map(int,input.split(' '))
  for i in temp:
    a[i]+=1
c=0
for i in range(1,n+1):
  if(a[i]==0):
    c++
print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
l = []
for k in range(K):
    a = int(input())
    for i in range(a):
        l.append(int(input()))
print(l)
for j in range(N):
    if not j+1 in l:
        print(j+1)

Submission status: Runtime Error

Solution code:
N=input()
K=input()
l=[]
for k in range(K):
  a=input()
  for i in range(a):
    l.append(input())
  
for j in range(N):
  if j not in l:
    print(j)

Submission status: Runtime Error

Solution code:
N=input()
K=input()
l=[]
for k in range(K):
  a=input()
  for i in range(a):
    l.append(input())
  
for j in range(N):
  if j != in l:
    print(j)

Submission status: Runtime Error

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

snukes = [0] * N
for i in range(K):
  d_i = int(input()) # throw away
  a_i = map(int, input().split())
  for a in a_i:
    snukes[a] += 1

counter = 0
for i in range(N):
  if snukes[i] == 0:
    counter += 1

print(counter)

Submission status: Runtime Error

Solution code:
N,K = map(int,input().split(' '))
d = int(input())
lst = [map(int,input().split(' ')) for i in range(K+1)]
lst1 = [0]*N
decision_flag = True
for i in lst:
    if decision_flag == True:
        decision_flag = False
        for i1 in i:
            lst1[i1-1] = 1

    else:
        decision_flag = True
print(lst1.count(0))

Submission status: Runtime Error

Solution code:
n,k = map(int,input(),split())
a = [0 for i in range(n)]

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

Submission status: Runtime Error

Solution code:
ふぁ

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

for n in range(N):
  input()
  S|=set(input().split())

print(N-len(S))

Submission status: Runtime Error

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

for n in range(N):
	input()
	S|=set(input().split())

print(N-len(S))

Submission status: Runtime Error

Solution code:
k=int(input())
a,b=map(int,input().split())


f= False
for d  in range (a,b+1):
    if d % k == 0:
        f=True
        break


if f :
    print('OK')
else :
    print('NG')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
[N, K] = list(map(int, input().split()))
all_A =[]

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

Solution code:
import sys

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

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

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

    syugou = syugou+a[i]

num = set(syugou)

print(n-len(num))

Submission status: Runtime Error

Solution code:
import sys

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

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

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

    syugou = syugou+a[i]
    ans = set(syugou)

num = list(ans)

print(n-len(num))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10**7)

stdin = sys.stdin

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

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

Submission status: Runtime Error

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

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

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

Submission status: Runtime Error

Solution code:
s = input().rstrip().strip()
n= int(s[0])
k = int(s[1])
d = int(input())

print(n-d)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

print(sunuke)

Submission status: Runtime Error

Solution code:
total,okasi=map(int,input().split())
sunuke=[]

for i in range(okasi):
  di=int(input)
  A=list(map(int,input().split()))
  for a in A:
    sunuke.append(input())
    
print(total-len(set(sunuke)))

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
a = []
for i in range(K):
  di = int(input())
  for j in range(di):
    a.append(map(int, input().split())

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

Submission status: Runtime Error

Solution code:
n,k = list(map(int,input()))
snukes = [0]*n
count = 0
for _ in range(k):
  d = int(input())
  temp = list(map(int,input().split()))
  for i in range(len(temp)):
    snukes[i]+=temp[i]
for i in snukes:
  if i==0:
    count+=1
print(count)

Submission status: Runtime Error

Solution code:
from copy import copy
from functool import reduce

class Sunkune:
	def __init__(self):
  		self.has_snack = False

n_sunuke, n_v_snacks = [int(s) for s in input().split(2)]

all_sunuke = [copy(Sunuke()) for i in range(n_sunuke)]

for snack_id in n_v_snacks:
  	n_snacks = int(input())
    for sunuke_id in (int(s) for s in input().split()):
    	all_sunuke[s - 1].has_snack = True

print(reduce(lambda n,s: n + (0 if s.has_snack else 1), all_sunuke, 0)

Submission status: Runtime Error

Solution code:
N, K = input().split()
d = []
A = []

for _ in K:
    d.append(input())
    num = d[-1]
    for i in num:
        A.append(input())

for j in max(d)+1:
    if j+1 in A:
        pass
    else:
        print(j+1)

Submission status: Runtime Error

Solution code:
N, K = input().split()
d = []
A = []
for _ in K:
    d.append(int(input()))
    num = d[-1]
    for i in num:
        A.append(int(input()))

for j in max(d)+1:
    if j+1 in A:
        pass
    else:
        print(j+1)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
d, a = [], []
for i in range(2*k):
  if i%2:
    d.append(int(input()))
  else:
    a.append(list(map(int, input().split())))
print(n - len(set(d)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

for k in range(K):
    hito_len = int(input())
    have_hito = map(int, input().split())
    for hh in range(have_hito):
        have_snack[hh - 1] = 1

print(have_snack.count(0))

Submission status: Runtime Error

Solution code:
n, k = map(int,input().split())
d = int(input())
for x in range(k + 1):
    map(int,input().split())
print(n-d)

Submission status: Runtime Error

Solution code:
n, k = map(int,input().split())
d = int(input())
for x in range(k + 1):
    input()
print(n-d)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
LI=list(range(1,n+1))
kari=n+1
for i in range(k):
  d=int(input())
  li=list(map(int,input().split()))
  for x in range(1,n):
    if li.count(x)!=0:
      LI.remove(x)
print(len(LI)-1)

Submission status: Runtime Error

Solution code:
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

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 1
    else:
        ans += 0

print(ans)

Submission status: Runtime Error

Solution code:
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

for j in a:
    for t in j:
        aa[t - 1] += 1

ans = 0

for z in aa:
    if z == 0:
        ans += 0

print(ans)

Submission status: Runtime Error

Solution code:
N,K = map(int, input().split(" "))
flag = [1 for i in range(N)]
for i in range(K):
  input()
  a = map(int, input().split(" "))
  for j in a:
    flag[a - 1] = 0
print(sum(flag))

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3

from typing import Iterable


def main() -> None:
    N, K = rmi()
    D, A = [], []
    for n in range(N):
        d = ri()
        D.append(d)
        A.append(rmi())
    target = [False] * N
    for k in range(K):
        for a in A[k]:
            target[a] = True
    w(target.count(False))


def r() -> str:
    return input().strip()


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


def rmi(delim: str = ' ') -> int:
    return tuple(map(int, input().split(delim)))


def w(data) -> None:
    print(data)


def wm(data: Iterable) -> None:
    print(' '.join(data))


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
okashi = [0] * N
for k in range(K):
  d = int(input())
  a = list(input().split())
  assert(len(a) == d)
  for a1 in a:
    okashi[int(a1)]+=1
n = 0
for o1 in okashi:
  if o1 == 0:
    n += 1
print(n)

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))

sunuke = []
ans = 0
for n in range(s[0]):
  sunuke.append(0)
for n in range(len(s)):
  d = input()
  a = list(map(int, input().split()))
  for n2 in a:
    sunuke[n2-1] += 1
for n in sunuke:
  if n == 0:
    ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
K = int(input())
okashi = [0] * N
for k in range(K):
  d = int(input())
  a = list(input().split())
  assert(len(a) == d)
  for a1 in a:
    okashi[a1]+=1
n = 0
for o1 in okashi:
  if o1 != 0:
    n += 1
print(n)

Submission status: Runtime Error

Solution code:
l = input().split()
n, k = int(l[0]), int(l[1])
a = []
d = []
for x in range(k):
  x = input()
  a = input().split()
  for y in range(len(a))
  d.append(a[y])
b = k - len(set(d))
print(b)

Submission status: Runtime Error

Solution code:
l = input().split()
n, k = int(l[0]), int(l[1])
a,d = [], []
for x in range(k):
  d.append().input()
  a.append().int().input().split()
b = set(a)
c = k - len(b)
print(c)

Submission status: Runtime Error

Solution code:
l = input().split()
n, k = int(l[0]), int(l[1])
a = []
for x in range(k):
  d.append().input()
  a.append().int().input().split()
b = set(a)
c = k - len(b)
print(c)

Submission status: Runtime Error

Solution code:
l = input().split()
n, k = int(l[0]), int(l[1])
a = []
for x in range(k):
  a.append().input()
b = set(a)
c = k - len(b)
print(c)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
for k in range(k):
	d = int(input())
	for d in range(d):
    a.append({int(x) for x in input().split()})
    n = array_diff(n,a)
print(len(n))

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
for k in range(k):
	d = int(input())
	for d in range(d):
    a.append({int(x) for x in input().split()})
    n = array_diff(n,a)
print(n)

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
for k in range(k):
	d = input()
	for d in range(d):
      a = input()
    n = array_diff(n,d)
print(n)

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
for k in range(k):
	for n in range(n):
      a = list(map(int, input().split()))
      n = array_diff(n,a)
print(n)

Submission status: Runtime Error

Solution code:
n,k = map(int, input().split())
for k in range(k+1):
	for d in range(n):
      a = list(map(int, input().split()))
      n = array_diff(n,a)
print(n)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split(" "))
flag = [for 1 in range(N)]
for i in range(K):
  input()
  for j in map(int,input().split(" ")):
    flag[j-1] = 0
sum(flag)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
flag = [for 1 in range(N)]
for i in range(K):
  input()
  for j in map(int,input().split()):
    flag[j-1] = 0
sum(flag)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;

int main ()
{
	int n,k, ans = 0;
	vi snukes;
	cin >> n >> k;
	snukes.resize(n+1, 0);
	for(int i = 0; i < k; i++)
	{
		int d;
		cin >> d;
		for (int j = 0; j < d; j++)
		{
			int x;
			cin >> x;
			snukes[x]++;			
		}
	}
	for(int i = 1; i < snukes.size(); i++)
	{
		if(snukes[i] == 0)
			ans++;
	}
	cout << ans << "\n";
}

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
mp = {}
for j in arr:
  if j not in mp:
    mp[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(map(int, input().split()))
  for x in temp:
    if x in mp:
      mp[x] += 1
count = 0
for ans in arr:
  if ans in mp and mp[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
mp = {}
for j in arr:
  if j not in mp:
    mp[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(map(int, input().split()))
  for x in temp:
    if x in mp:
      mp[x] += 1
count = 0
for ans in arr:
  if mp[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
mp = {}
for j in arr:
  if j not in mp:
    mp[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(mp(int, input().split()))
  for x in temp:
    if x in mp:
      mp[x] += 1
count = 0
for ans in arr:
  if mp[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
print(ans)
map = {}
for j in arr:
  if j not in map:
    map[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(map(int, input().split()))
  for x in temp:
    if x in map:
      map[x] += 1
count = 0
for ans in arr:
  if map[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
map = {}
for j in arr:
  if j not in map:
    map[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(map(int, input().split()))
  for x in temp:
    if x in map:
      map[x] += 1
count = 0
for ans in arr:
  if map[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
arr = [x for x in range(1, n + 1)]
map = {}
for j in arr:
  if j not in map:
    map[j] = 1
    
for i in range(k):
  d = int(input())
  for sn in range(d):
    temp = list(map(int, input().split()))
  for x in temp:
    if x in map:
      map[x] += 1
count = 0
for ans in map:
  if map[ans] == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
init=input().split()
num=init[0]
snacks=init[1]
ceck=[]
for i in range(snacks):
  sNum=input()
  if sNum>1:
    whos=input().split()
    for j in range(sNum):
      check.append()=whos[j]
  else:
    who=input()
    check.append()=who

for i in range(num):
  if not str(num[i]) in check:
    print(num)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
list = []
for p in range(k):
  m = int(input())
  k_list = list(map(int, input().split()))
  for q in k_list:
    if not q in list:
      list.append(q)
k_l = len(k_list)
print(n-k_l)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n_list = list(range(1, n+1))
for _ in range(k):
    d = int(input())
    for _ in range(d):
        a = int(input())
        if a in n_list:
            n_list.remove(a)
print(len(n_list))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n_list = list(range(1, n+1))
for _ in range(k):
    d = int(input())
    for _ in range(d):
        a = int(input)
    if a in n_list:
        n_list.remove(a)
print(len(n_list))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
n_list = list(range(1, n+1))
for _ in range(k):
  d = int(input())
  for _ in range(d):
    a = int(input)
    if a in n_list:
      n_list.remove(a)
print(len(n_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, k = int(input())
l_n = [0] * n
for i in range(0, k):
    d = int(input())
    a = int(input())
    for l in a:
        l_n[l-1] = 1
print(l_n.count(0))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split(" ")]

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a += (int(m) for m in input().split())

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a += [int(m) for m in input().split()]

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a.add(list((map(int, input().split())))

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  a.append(map(int, input().split()))

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  while m <= d:
    l = int(input())
    a.append(l)
    m += 1

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for _ in range(k):
  d = int(input())
  while m <= d:
    a.append(int(input()))
    m += 1

print(n - len(a))

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
a = set()

for m in range(k):
  d = int(input())
  print(d)
  for l in range(d):
    a.append(range(n))
  print(a)

Submission status: Runtime Error

Solution code:
n,k = map(int,input().split())
lst = []
for _ in range(k):
  d = int(input())
  lstx = [int(input()) for _ in range(d)]
  lst += lstx
setans = set(lst)
print(n - len(setans))

Submission status: Runtime Error

Solution code:
import random
n = int(input())
k = int(input())
l = 0

while l <= k:
  d = random.randint(1, n)
  print(d)
  for m in range(d):
    print(random.randint(1, n))
  l += 1

Submission status: Runtime Error

Solution code:
import random
n = list(x for x in range(input()))
k = int(input())
l = 0

while l <= k:
  d = random.randint(1, n)
  print(d)
  for m in range(d):
    print(random.choice(n))
  l += 1

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(N+1)]

indexs = []
for i in range(len(L)):
    if i%2 != 0:
        indexs.append(L[i])

uniq_list = []
for li in indexs:
    for e in li:
        if e not in uniq_list:
            uniq_list.append(e)

print(N - len(uniq_list))

Submission status: Runtime Error

Solution code:
#!usr/bin/env python3
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect

def LI(): return [int(x) for x in sys.stdin.readline().split()]


def I(): return int(sys.stdin.readline())


def LS(): return [list(x) for x in sys.stdin.readline().split()]


def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res


def IR(n):
    return [I() for i in range(n)]


def LIR(n):
    return [LI() for i in range(n)]


def SR(n):
    return [S() for i in range(n)]


def LSR(n):
    return [LS() for i in range(n)]


sys.setrecursionlimit(1000000)
mod = 1000000007


def solve():
    n, k = LI()
    flag_list = [False] * n
    for _ in range(k-1):
        d = I()
        a = LIR(max(d-1, 1))
        for i in range(d):
            flag_list[a[0][i]-1] = True
    print(flag_list.count(False))
    
    return


if __name__ == "__main__":
    solve()