Problem:
 Score : 200 points    Problem Statement N  Snukes called Snuke 1 , Snuke 2 , ..., Snuke N live in a town.  There are K kinds of snacks sold in this town, called Snack 1 , Snack 2 , ..., Snack K . The following d_i Snukes have Snack i : Snuke A_{i, 1}, A_{i, 2}, \cdots, A_{i, {d_i}} .  Takahashi will walk around this town and make mischief on the Snukes who have no snacks. How many Snukes will fall victim to Takahashi's mischief?      Constraints  All values in input are integers.  1 \leq N \leq 100  1 \leq K \leq 100  1 \leq d_i \leq N  1 \leq A_{i, 1} < \cdots < A_{i, d_i} \leq N         Input Input is given from Standard Input in the following format:  N  K  d_1  A_{1, 1} \cdots A_{1, d_1}  \vdots  d_K  A_{K, 1} \cdots A_{K, d_K}       Output Print the answer.        Sample Input 1 3 2
2
1 3
1
3      Sample Output 1 1   Snuke 1 has Snack 1 .  Snuke 2 has no snacks.  Snuke 3 has Snack 1 and 2 .   Thus, there will be one victim: Snuke 2 .       Sample Input 2 3 3
1
3
1
3
1
3      Sample Output 2 2

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

list = []
for i in range(1,n+1):
    list.append(i)
for risu in num_list:
    for x in risu:
        if x in list:
            list.remove(x)
tuple = tuple(list)


print(len(tuple))

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

for i in range(k):
  j = int(input())
  ls = list(input().split())
  anslist |=set(ls)


print(n-len(anslist))

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

for j in range(1, N+1):
  if j in A:
    pass
  else:
    B.append(j)
print(len(B))

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

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

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

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

Solution (Python):
def main():
    N, K = map(int, input().split())
    masterArray = []
    for i in range(K):
        _ = input()
        haveNumber = list(map(int, input().split()))
        masterArray.extend(haveNumber)
    result = set(masterArray)
    print(N - len(result))


if __name__ == "__main__":
    
    main()

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

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

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

    for j in range(d[i]):
        s1.add(A[i][j])

s_diff = s0 - s1

print(len(s_diff))

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

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

ans = N
A = sum(A, [])
for i in range(1,N+1):
    if i in A:
        ans -= 1
      
     
print(ans)

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

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

Solution (Python):
N,K = map(int,input().split())
a = []
for i in range(N):
    a.append(0)
for i in range(K):
    d_i = int(input())
    A_i = list(map(int,input().split()))
    for k in range(N):
        if (k+1 in A_i) == True :
            a[k] =a[k] + 1
sum = 0
for i in range(N):
    if a[i] == 0:
        sum += 1
print(sum)

Solution (Python):
from itertools import chain

a = list(open(0))
n = int(a[0].split()[0])
print(n - len(set(chain.from_iterable(map(str.split, a[2::2])))))

Solution (Python):
N,K = map(int, input().split())
A = []
for i in range(K) :
    d = int(input())
    A.append(input().split(" "))
    
snukeList = []
for i in range(len(A)) :
    for j in range(len(A[i])) :
        snukeList.append(int(A[i][j]))
count = 0
for i in range(1, N+1) :
    if i in snukeList :
        continue
    count += 1
print(count)

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

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

ref = A[0]

for i in range(1, K):
  ref = list(set(ref) & set(A[i])) + list(set(ref) ^ set(A[i]))

len = len(ref)

print(N - len)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
arr = []
n,k= list(map(int,readline().rstrip().split()))
for i in range(k):
  s = readline()
  t = readline().rstrip().decode().split()
  arr.extend(t)

print(n-len(set(arr)))

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

for i in range(K):
  d=int(input())
  a=list(map(int, input().split()))
  for j in range(d):
    S[a[j]-1]=1
print(len([i for i,x in enumerate(S) if x==0]))

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

z = 0
l = [0]
for i in range(k):
  d=int(input())
  s =list(map(int,input().split()))
  l.extend(s)
for i in range(n+1):
  if l.count(i)==0:
    z = z + 1
print(z)

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

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

print(m.count(0))

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

Solution (Python):
li = list(map(int, input().split()))
N, K = li[0], li[1]
d = []
A = []
for i in range(K):
    d.append(input())
    A.append(list(map(int, input().split())))
sunuke = list(range(1, N+1))
treated = []
for Ai in A:
    for x in Ai:
        if x not in treated:
            treated.append(x)
tricked = list(set(sunuke) - set(treated))
print(len(tricked))

Solution (Python):
import collections
s=[]
a=[]
S =  list(map(int,input().split()))
N = S[0]
K = S[1]
for i in range(1,K+1):
    d = int(input())
    A = list(map(int,input().split()))
    a.append(A)
for t in range(1,N+1):
    s.append(t)
import itertools
aa=list(itertools.chain.from_iterable(a))
c = collections.Counter(aa)
print(len(s)-len(c))

Solution (Python):

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


c=sum(A, [])
c=set(c)
NN=len(c)
ans=N-NN
print(ans)

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

Solution (Python):
inputs = []
while True:
  try:
    inputs.append(input())
  except EOFError:
    break



people = eval(inputs[0].split(" ")[0])
snack = eval(inputs[0].split(" ")[1])

having_snacks = [[eval(i) for i in a.split(" ")] for a in inputs[2::2]]
having_snacks = set(sum(having_snacks, []))

print(people - len(having_snacks))

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

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

A = [-1] * n

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

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

print(ans)

Solution (Python):
n, k =map(int, input().split())
l=list(range(1,n+1,1))
for i in range(k):
    d=int(input())
    t=list(map(int, input().split()))
    for q in range(d):
        if (t[q] in l)==1:
            l.remove(t[q])
print(len(l))

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

for number_of_candies in range(k):
    d = int(input())
    sunuke_list = map(int, input().split())
    for sunuke in sunuke_list:
        safe_sunuke_set.add(sunuke)

print(n - len(safe_sunuke_set))

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

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

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

data = [[0 for i in range(k)] for j in range(n)]

for i in range(0, k):
    d = int(input())
    a = [int(s) for s in input().split()]

    for m in a:
        data[m - 1][i] = 1

dd = []

for d in data:
    dd.append(sum(d))

ans = 0

for ddd in dd:
    if ddd == 0:
        ans += 1

print(ans)

Solution (Python):
N, K = map(int, input().split())
sunukes = [1 for _ in range(N)]
for _ in range(K):
    d = input()
    owner_list = [int(i) for i in input().split()]
    for owner in owner_list:
        sunukes[owner-1] = 0
print(sum(sunukes))

Solution (Python):
N,K=map(int, input().split(" "))
d=[0]*K
A=[0]*K
dic={}
for i in range(K):
    d[i]=int(input())
    A[i]=input().split()
for j in range(K):
    if d[j]==1:
        if A[j][0] not in dic:
                dic[A[j][0]]=1
    if d[j]!=1:
        for k in range(d[j]):
            if A[j][k] not in dic:
                dic[A[j][k]]=1
print(N-len(dic))

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

Solution (Python):
n, k = input().split()
sunuke = {}

for i in range(1, int(n)+1):
  sunuke[i] = sunuke.get(i, 0)

for i in range(0, int(k)):
  okashi = input()
  mochi = list(map(int, input().split()))
  for j in range(0, len(mochi)):
    sunuke[mochi[j]] += 1

count = 0
for key, value in sunuke.items():
    if value == 0:
        count += 1
print(count)

Solution (Python):
n , k = map(int , input().split())
done = set()
for i in range(k):
	c = int(input())
	arr = list(map(int , input().split()))
	for ele in arr:
		done.add(ele)
ans = 0
for i in range(1,n+1):
	if i not in done:
		ans+=1
print(ans)

Solution (Python):
N,K = map(int,input().split(' '))
A_list = []
count = 0
for i in range(K):
    di = int(input())
    Ai = list(map(int,input().split(' ')))
    [A_list.append(A) for A in Ai]
set_a = set(A_list)
count = N - len(set_a)
print(count)

Solution (Python):
N,K = map(int,input().split(" "))
trickSum = 0
result = list()
for i in range(K):
    d = input()
    result = result + (list(map(int, input().split(" "))))
print(N - len(set(result)))

Solution (Python):
n, k =map(int,input().strip().split())
ans=[0]*n
for i in range(k):
    store=int(input())
    li = list(map(int,input().strip().split()) )
    for k in range(len(li)):
        ans[li[k]-1]=1

print(ans.count(0))

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

list1 = [0]*N
for i in range(K):
    d = int(input())
    haved = input().split()
    for j in haved:
        arg = int(j)-1
        list1[arg] += 1
print(list1.count(0))

Solution (Python):
import sys
def inpl(): return list(map(int, sys.stdin.readline().split()))

x = inpl()
N = []
cnt = 0
for i in range(0, x[0]):
    N.append(0)

for i in range(0, x[1]):
    tem = int(input())
    A = inpl()

    for j in range(0, tem):
        N[A[j]-1] += 1

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

print(cnt)

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

Solution (Python):
n,k=map(int,input().split())
a=list()
for i in range(1,n+1):
    a.append(i)

for i in range(k):
    d=int(input())
    b=list(map(int, input().split()))
    for j in range(d):
        try:
            a.remove(b[j])
        except ValueError:
            pass

print(len(a))

Solution (Python):
N, K = map(int,input().split())
List = []
for i in range(1,N+1):
  List.append(i)

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

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

print(count)

Solution (Python):
def main():
    N, K = map(int, input().split())
    d_list = []
    Ai_list = []
    dict = {}
    b_list = []
    for i in range(0,K) :
        d = int(input())
        d_list.append(d)
        A_list = [A for A in input().split()]
        A_list = list(map(int, A_list))
        dict[d] = A_list
        b_list.extend(A_list)
        A_list = []

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


if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
c = []
for i in range(b):
    d = int(input())
    c.append([d, list(map(int, input().split()))])
e = 0
for i in range(1, a+1):
    for j in c:
        if i in j[1]:
            break
    else:
        e += 1
print(e)

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

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

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

sunukes = []

for i in range(K):
    _ = int(input())
    p = list(map(int, input().split()))
    
    for j in range(len(p)):
        if p[j] not in sunukes:
            sunukes.append(p[j])

n = 0

for i in range(N):
    if i+1 not in sunukes:
        n += 1

print(n)

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

Solution (Python):
import sys
import re

N, K = map(int, input().split())
A = sys.stdin.readlines()

A = [b.strip() for b in A]

l_temp = []
for i in range(K*2):
  if i % 2 == 0:
    d = A[i]
    ary = A[i+1].split()
    for item in ary:
      l_temp.append(item)

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

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

arr = [ 1 for x in range ( N ) ] ;
for x in range ( K ) :
	r = input() ;
	for x in map( int, input().strip().split(" ") ) :
		arr[x-1] = 0 ;
print ( sum( arr ) ) ;

Solution (Python):
import itertools
import collections

n, k = map(int, input().split())
a = []

for i in range(k):
    d = int(input())
    a.append(input().split())

array = list(itertools.chain.from_iterable(a))
c = collections.Counter(array)

print(n - len(c))

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

for i in range(n):
    sun.append(0)

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

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


print(ans)

Solution (Python):
N,K = map(int,input().split())
A = []
count = 0
for i in range(K):
    d = int(input())
    B = [int(i) for i in input().split()]
    for i in range(d):
        A.append(B[i])
for i in range(1,N+1):
    if not i in A:
        count += 1
print(count)

Solution (Python):
a=list(map(int,input().split()))
b,c=[],[]
ans=set()
for _ in range(a[1]):
    b.append(int(input()))
    c.append(list(map(int,input().split())))
for i in range(a[1]):
    for j in range(b[i]):
        ans.add(c[i][j])
print(a[0]-len(ans))

Solution (Python):
n,k=map(int,input().split())
s=[1]*n
for c in range(k):
    d=int(input())
    a=[int(x)-1 for x in input().split()]
    for b in a:
        s[b]=0
print(sum(s))

Solution (Python):

import sys
from collections import Counter
input = sys.stdin.readline
N,K = (int(x) for x in input().split())
d=[-1]*K

A=[] 

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

hito_kasi   =Counter(A)
hito_all    =set(i for i in range(1,N+1))
kasi_motteru= set(hito_kasi.keys())
ans         =hito_all - kasi_motteru
print(len(ans))

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

Solution (Python):
n,k=[int(s) for s in input().split(' ')]
gl=[]
c=0
for _ in range(k):
    z=input()
    for s in input().split(' '):
         gl.append(int(s))

for sn in range(1,n+1):
    if sn in gl:
        continue
    else:
        c+=1
print(c)

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

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

for i in range(K):
  d = int(input())
  drops = list(map(int,input().split()))
  for k in drops:
    if k in num:
      num.remove(k)

print(len(num))

Solution (Python):

a,b = map(int, input().split())
count=[0]*a
for i in range(b):
    n = int(input())
    num_list = list(map(int, input().split())) 
    for j in num_list:
       count[j-1]+=1
c=0

for i in range(a):
    if count[i]==0:
        c+=1
print(c)

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

member = set([])

for j in range(k):
    d = int(input())
    member = member.union(set(list(map(int,input().split()))))

print(n-len(member))

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

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

l = [0]*N
p = list()
for i in range(K):
    d = int(input())
    a = list(map(int, input().split()))
    p = p + a

p = list(set(p))

total = len(l) - len(p)
print(total)

Solution (Python):
nk = list(map(int, input().split()))
dic={}
for i in range(1,nk[0]+1):
    dic[str(i)]=0


for i in range(nk[1]):
    d=int(input())
    a = list(map(int, input().split()))
    for j in range(len(a)):
        dic[str(a[j])]=1

keys= [k for k, v in dic.items() if v == 0]
print(len(keys))

Solution (Python):
N,K=map(int,input().split())
d=[0]*K
A=[0 for _ in range(K)]
S=set([i+1 for i in range(N)])
for i in range(K):
  d[i]=int(input())
  A[i]=list(map(int,input().split()))
  for p in A[i]:
    if p in S:
      S.remove(p)
      

print(len(S))

Solution (Python):
def main():
    N, K = map(int, input().split())
    A = [0] * (N+1)
    A[0] = 1
    for _ in range(K):
        D = int(input())
        AD = list(map(int, input().split()))   
        for i in AD: A[i] = 1

    sum = 0
    for j in A:
        if j == 0: sum += 1

    print(sum)

main()

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

Aset = set()
Alist = list()
ans = 0

for count in range(2 * K):
    if count % 2 != 0:
        Alist.extend(dA[count])

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

Solution (Python):

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

    dic = {}
    for i in range(N):
        dic[i+1] = 0
        
    for i in range(K):
        dk = int(input())
        Ak = list(map(int, input().split()))
        for a in Ak:
            if a in dic:
                del dic[a]
    print(len(dic))

solve()

Solution (Python):
from collections import Counter
x=[]
n,k=list(map(int,input().split()))
for i in range(k):
    d=int(input())
    a=list(map(int,input().split()))
    x.extend(a)
y=Counter(x)
print(n-len(set(y)))

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

sunuke_list = [0]*N

for _ in range(K):
	input()
	l = list(map(int, input().strip().split()))
	for i in l:
		sunuke_list[i-1] = 1

print(sunuke_list.count(0))

Solution (Python):
import numpy as np

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

A = sum(A, [])
ans = N - len(np.unique(A))
print(ans)

Solution (Python):

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


dic = {}
for i in range(1,n+1):
    dic[i] = 0

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


ans = 0
for k,v in dic.items():
    if v == 0:
        ans += 1
print(ans)

Solution (Python):
import sys

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

Input = []
while True:
    try:
        d = int(input())
        i = list(map(int, input().split()))
        Input += i
        
    except Exception as e:
        break






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

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

Solution (Python):
inputlist = list(map(int, input().split()))
snum = inputlist[0]
kindofsweets = inputlist[1]
setofkind = []
for i in range(kindofsweets):
    input()
    setofkind += (list(map(int, input().split())))
counter = 0
for i in range(snum):
    if i + 1 not in setofkind:
        counter += 1
print(counter)

Solution (Python):
O=list(map(int, input().split()))
N = O[0]
K = O[1]
L = []
for i in range(N):
    L.append(1)
    

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

sumx = 0

for i in range(N):
    sumx+=L[i]
    
print(sumx)

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

for k in range(K):
    d = int(input())
    Alist = list(map(int, input().split()))
    for i in Alist:
        have[i-1] = 1

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

print(ans)

Solution (Python):
n,k=[int(_) for _ in input().split()]
s=set()
for a in range(k):
    x=int(input())
    y=[int(_) for _ in input().split()]
    for b in y:
        s.add(b)
print(len(set(range(1,n+1))-s))

Solution (Python):
N,K = map(int,input().split())
c = 0
listA = []
for k in range(1,K+1):
    d = int(input())
    listA += list(map(int,input().split()))
    
for n in range(1,N+1):
    if n not in listA:
        c += 1
print(c)

Solution (Python):
temp=input().split(" ")
N=int(temp[0])
K=int(temp[1])
sum=0
snucklist=[]
for i in range(1,K+1):
    d=int(input())
    templist=input().split(" ")
    for j in range(0,d):
        if int(templist[j]) not in snucklist:
            snucklist.append(int(templist[j]))
for t in range(1,N+1):
    if t not in snucklist:
        sum=sum+1
print(sum)

Solution (Python):
NK=list(map(int,input().split()))
d=[0]*NK[1]
A_list=[]

for j in range(NK[1]):
    d[j-1]=int(input())
    A_in=list(map(int,input().split()))
    A_list.append(A_in)

N_list=list(range(1,NK[0]+1))
A_sort=[]
for A in A_list:
    for a in A:
        A_sort.append(a)
print(NK[0]-len(set(A_sort)))

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=[]
for i in range(len(A)):
  for j in range(len(A[i])):
    if not(A[i][j] in a):
      a.append(A[i][j])



print(n-len(a))

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

Solution (Python):
N,K=map(int,input().split())
d=[]
L=[]
for i in range(K):
  d.append(int(input()))
  L+=list(map(int,input().split()))
L1=set(L)
U=set([i for i in range(1,N+1)])
print(len(U-L1))

Solution (Python):

def main():
    N,K = map(int,input().split())
    ans = []
    for i in range(K):
        tmp = []
        S = int(input())
        tmp = list(map(int, input().split()))
        ans.extend(tmp)
        
    print(N-(len(set(ans))))

if __name__ == '__main__':
    main()

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

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

Solution (Python):



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


okashi = [0 for _ in range(n)]
for i in range(k):
    for j in range(d[i]):
        okashi[A[i][j]-1] += 1
ans = 0 
for i in range(len(okashi)):
    if okashi[i] == 0:
        ans += 1
print(ans)

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

Solution (Python):
import bisect
import copy
import heapq
import sys
import itertools
import math
import queue
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
mod = 10 ** 9 + 7

def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for n in range(N)]
def init_dp1(init, N): return [init for _ in range(N)]
def init_dp2(init, N, M): return [[init for _ in range(M)] for _ in range(N)]


class V:
    def __init__(self, f, v=None):
        self.f = f
        self.v = v
 
    def __str__(self):
        return str(self.v)
 
    def ud(self, n):
        if n is None:
            return

        if self.v is None:
            self.v = n
            return
        self.v = self.f(self.v, n) 


def main():
    N, K = read_values()
    S = set(i for i in range(N))

    for _ in range(K):
        input()
        A = tuple(read_index())
        for a in A:
            if a in S:
                S.remove(a)
    
    print(len(S))


if __name__ == "__main__":
    main()

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

arr = []

for i in range(int(K)):
    input()
    arr.append(list(input().split()))


snuk = [0] * int(N)

for di in arr:
    for i in di:
        snuk[int(i)-1] = 1


num = 0


for i in snuk:
    if i == 0:
        num = num+1

print(num)

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


count = 0
li = []
for i in range(K):
    for a in A[i]:
        if not a in li:
            count += 1
            li.append(a)

print(N - count)

Solution (Python):

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

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

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

for j in range(k):
  for l in range(D[j]):
    a[A[j][l]-1] += 1

print(a.count(0))

Solution (Python):
N, K = map(int,input().split())
s = {}
for j in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for i in A:
    s[i] = True
    
print(N - len(s))

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

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

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

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

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

t = 0
for i in range(1,n+1):
    if i in a_list:
        t += 1
print(n-t)

Solution (Python):
import itertools
n_people, n_food = map(int, input().split(" "))
d_list = []
A_list = []
for i in range(n_food):
    d = int(input())
    A = [int(_) for _ in input().split(" ")]
    d_list.append(d)
    A_list.append(A)
    
print(n_people - len(set(itertools.chain.from_iterable(A_list))))

Solution (Python):
N,K=map(int,input().split())
dlist=[]
Alist=[]
myset1=set([])

for i in range(K):
    d=int(input())
    dlist.append(d)
    templist=list(map(int,input().split()))
    for j in range(len(templist)):
        Alist.append(templist[j])
    
    
    
myset1=set(Alist)    





print(N-len(myset1))

Solution (Python):
n,k = (int(i) for i in input().split())
d = 0
a = []
c = set( [i for i in range(1,n+1)])
for i in range(k):
	d = int(input())
	a.extend(int(i) for i in (input().split()))

b = set(a)
d = c-b
print(len(d))

""""
n,m = (int(i) for i in input().split())
h = [int(i) for i in input().split()]
ab =[]
for i in range(m):
	ab.append(list(map(int,input().split())))
	"""

Solution (Python):
x = input().split()
n = int(x[0])
k = int(x[1])*2
s = [input().split() for i in range(k)]
l = []
for i in range(0, k):
  if i%2 != 0:
    for j in range(1, n+1):
      if (str(j) in s[i]) == True:
        l.append(j)
        pass
count = 0
for i in range(1, n+1):
  if (i in l) == False:
    count += 1
print(count)

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

d = []
t = ()

for _ in range(K):
    d.append(int(input()))
    a = list(map(int, input().split()))
    t = t + tuple(a)

nums_unique = list(set(t))

print(N - len(nums_unique))

Solution (Python):
nk = list(map(int,input().split()))
n,k = nk[0],nk[1]
d = []
a = []
for i in range(k):
    dd = int(input())
    d.append(dd)
    b = list(map(int,input().split()))
    a.append(b)
okasi = []
for i in range(k):
    for j in range(d[i]):
        okasi.append(a[i][j])
okasi = list(set(okasi))
hito = [i for i in range(1,n+1)]
for i in okasi:
    if i in hito:
        hito.remove(i)
ans = len(hito)
print(ans)

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

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

N,K=map(int,input().split())
d=[0]*K
A=[]
B=set()
for i in range(K):
    d[i]=int(input())
    A.append(list(map(int,input().split())))
    for j in A[i]:
        B.add(j)

print(N-len(B))

Solution (Python):

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

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


sunuke=[0]*N
for j in range(K):

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

print(sunuke.count(0))

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

treated = (list(range(1, N+1)))

for i in range(K):
  tt = list(set(list(range(1, N+1))) - set(l[2*i+1]))
  treated = list(set(treated) & set(tt))

print(len(treated))

Solution (Python):
def main():
    N, K = map(int, input().split())
    s_sunuke = set()
    d = [-1] * K
    A = [None] * K
    for i in range(1, K + 1):
        d[i-1] = int(input())
        s_sunuke = s_sunuke | set([int(x) for x in input().split()])
    
    print(N - len(s_sunuke))




if __name__ == "__main__":
    main()

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

for i in range(k):
    d.append(int(input()))
    a.extend(list(map(int,input().split())))
    
ans = list(set(a))
print(n - len(ans))

Solution (Python):
n, k = map(int, input().split())
li = []
for x in range(k*2):
    li.append(input().split())
li2 = []
i = 1
while i < k*2:
    for j in li[i]:
        li2.append(j)
    i += 2
li2 = set(li2)
print(n - len(li2))

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

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

for m in range(1, n + 1):
	if m not in A:
		count += 1

print(count)