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(i) for i in input().split()]
dicter = dict()
for i in range(1, n + 1):
    dicter[i] = []

for i in range(k):
    di = int(input())
    lister = [int(j) for j in input().split()]
    for j in lister:
        dicter[j].append(di)

sumer = 0
for i in range(1, n + 1):
    if dicter[i] == []:
        sumer += 1

print(sumer)

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

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

Solution (Python):

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

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

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

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

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

Solution (Python):
n, k = map(int, input().strip().split())
sunuke=[False]*n
for i in range(k):
    d=int(input().strip())
    L = list(map(int, input().strip().split()))
    for j in L:
        sunuke[j-1]=True
ans=0
for i in sunuke:
    if not i:
        ans+=1
print(ans)

Solution (Python):
import numpy as np 

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

result = [0]*N

for i in range (K):
    d = int(input())
    A = list(map(int,input().split()))
    for j in range (d):
        result[A[j]-1]+=1
        
print(sum((np.array(result)==0)*1))

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

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

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

cnt = [0]*n

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

print(cnt.count(0))

Solution (Python):
def main():
    n, k = map(int, input().split())
    sunu = [1] * n
    for _ in range(k):
        d = int(input())
        dl = list(map(int, input().split()))
        for edl in dl:
            sunu[edl - 1] = 0
    print(sum(sunu))

if __name__ == '__main__':
    main()

Solution (Python):
import math

n, k = map(int, input().split(" "))
pL = [0 for _ in range(n)]

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

ans = 0

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

print(ans)

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

n_list = [1]*n

for i in range(k):
    d = int(input())
    for a in input().split():
        n_list[int(a)-1] = 0
print(sum(n_list))

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

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

B = set()
for i in range(k):
    for a in A[i]:
        B.add(a)

print(n-len(B))

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

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

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

Solution (Python):
def main():
    n, k = map(int, input().split())
    
    a = [None] * k
    ret = [1] * n
    for i in range(k):
        _ = input()
        for _a in map(int, input().split()):
            ret[_a-1] = 0
    print(sum(ret))



if __name__=="__main__":
    main()

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

a = []
for i in range(N):
    a.append(0)
    
for i in range(K):
    b = int(input())
    c = list(map(int,input().split()))
    for j in range(len(c)):
        a[c[j]-1] = 1

cnt = 0

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

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

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

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

ans = l.count(0)

print(ans)

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

    for j in range(d):
        a[b[j]]=1

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

Solution (Python):
def main():
    n,k=map(int,input().split())
    s=set()
    for _ in range(k):
        _=input()
        s|=set(map(int,input().split()))
    print(n-len(s))
main()

Solution (Python):
import numpy as np

N, K = map(int, input().split())
X = np.zeros(N, np.bool)
for _ in range(K):
    d = int(input())
    Z = [int(i) for i in input().split()]
    for z in Z:
        X[z - 1] = True
print(N - np.count_nonzero(X))

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

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

for i in range(k):
    num = input()
    num_list = list(map(int,input().split()))
    for j in num_list:
        n_list[j-1] = 1
cnt = 0
for i in n_list:
    if i == 0:
        cnt += 1
        
print(cnt)

Solution (Python):


from pprint import pprint
from collections import deque, defaultdict
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.buffer.readline
INF = float("inf")

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

d = []
flags = [0 for i in range(n + 1)]

for i in range(k):
    d.append(int(input()))
    line = list(map(int, input().split()))
    for l in line:
        flags[l] += 1

count = 0
for i in range(1, n + 1):
    if flags[i] == 0:
        count += 1

print(count)

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

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

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

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

for _ in range(k):
    input()
    tmp += [int(x) for x in input().split()]

print(len(set(range(1, n+1)) - set(tmp)))

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

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

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

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

Solution (Python):
def main():
    
    
    N, K = list(map(int, input().split(' ')))
    
    dn = []
    An = []
    for _ in range(K):
        dn.append(int(input()))
        An.extend(list(map(int, input().split(' '))))
        
    an = set(An)
    
    print(N - len(an))
    
        
    
        
    
    
    
    



main()

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

for j in a:
    for k in j:
        aa[k-1]+=1
        
ans=0

for x in aa:
    if x==0:
        ans+=1

print(ans)

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

Solution (Python):
def main():
    nk = list(map(int, input().split()))
    s = [0]*nk[0]
    for i in range(nk[1]):
        d = int(input())
        a = list(map(int, input().split()))
        for j in a:
            s[j-1] += 1
    print(s.count(0))

if __name__ == '__main__':
    main()

Solution (Python):
n , k = map(int, input().split())
x = [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]=0
print(sum(x))

Solution (Python):


def main():
     n, k = map(int, input().split())
     sunuke = [0 for i in range(n)]

     for i in range(k):
          num = int(input())
          have = list(map(int, input().split()))
          for k in have:
               sunuke[k-1] += 1
     
     ans = 0
     for i in range(len(sunuke)):
          if sunuke[i] == 0:
               ans += 1
     
     print(ans)

if __name__ == "__main__":
    main()

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

set_list = set(list)
ans = n - len(set_list)
print(ans)

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


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

Ns = 0
for i in H:
    if i ==0:
        Ns+=1



print(Ns)

Solution (Python):
def main():
  N, K = map(int, input().split())
  sunuke_l = [0] * N
  for _ in range(K):
    x = int(input())
    y = list(map(int, input().split()))
    for i in y:
      sunuke_l[i-1] += 1
  print(sunuke_l.count(0))
main()

Solution (Python):
n, k = list(map(int, input().split()))
okasi = [False] * n
for i in range(k):
    d_len = int(input())
    d = list(map(int, input().split()))
    for j in range(d_len):
        okasi[d[j]-1] = True

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

Solution (Python):
from collections import Counter
N,K=[int(i)for i in input().split()]
c=Counter([])
for i in range(K):
  input()
  c+=Counter([int(i)for i in input().split()])
  

print(N-len(c.keys()))

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

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

for _ in range(K):
    d = int(input())
    A = [int(n) for n in input().split()]

    for a in A:
        ans[a-1] += 1


print(ans.count(0))

Solution (Python):
n,k = map(int,input().split())
a = [h for h in range(1,n+1)]
s = set()
for i in range(k):
    d = int(input())
    x = list(map(int,input().split()))
    s |= set(x)

print(len(a)-len(s))

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

Solution (Python):



def solve(*args: str) -> str:
    n, k = map(int, args[0].split())

    T = [0]*n
    for A in args[2::2]:
        for a in map(int, A.split()):
            T[a-1] += 1

    return str(T.count(0))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

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

l = []
for i in range(K):
    l += A[i]
print(N - len(set(l)))

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())
  a = list(map(int,input().split()))
  for i in range(d):
    sun[a[i]-1]+=1
ans = 0
for i in range(n):
  if(sun[i]==0):
    ans+=1
print(ans)

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

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

for i in range(len(a)):
    for j in range(len(a[i])):
        if a[i][j] in a_remain:
            a_remain.remove(a[i][j])

print(len(a_remain))

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

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

print(ans.count(0))

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

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

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 A:
  L[j-1]+=1
b=0
for k in range(N):
 if L[k]==0:
  b+=1
print(b)

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import collections

mod = 10**9+7
sys.setrecursionlimit(mod) 

d = collections.deque()
def LI(): return list(map(int, sys.stdin.readline().split()))

N, K = LI()
d = [0 for i in range(K)]
A = [[] for i in range(K)]
for k in range(K):
    d[k] = int(input())
    A[k] = LI()

sunuke = [0 for i in range(N)]
for k in range(K):
    for s in A[k]:
        sunuke[s - 1] += 1

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

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

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

treat = [False] * N

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

print(sum([v == False for v in treat]))

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

Solution (Python):
import math
N,K = map(int,input().split())
has = [0]*(N+1)
for _ in range(K):
    input()
    items = list(map(int,input().split()))
    for item in items:
        has[item] = 1

print(N - sum(has))

Solution (Python):
from collections import defaultdict
N,K=map(int,input().split())
Hash=defaultdict(lambda:0)
for i in range(K):
    x=int(input())
    L=list(map(int,input().split()))
    for i in L:
        Hash[i]=1
count=0
for i in range(1,N+1):
    if Hash[i]==0:
        count+=1
print(count)

Solution (Python):

n, k = map(int, input().split())
a = [0]*k
has_k = [False]*n
count = 0

for i in range(k):
    tmp_d = int(input())
    tmp_a = list(map(int, input().split()))
    for ai in tmp_a:
        has_k[ai-1] = True

for ki in has_k:
    if ki == False:
        count += 1

print(count)

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 i in a:
        l[i - 1] = 1
cnt = 0
for i in l:
    if i == 0:
        cnt += 1
print(cnt)

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

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

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

s = set()

for _ in range(k):
  _ = input()
  a = list(map(int, input().split()))
  s |= set(a)

print(n - len(s))

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

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

print(n - len(a))

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

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

for i in range(k):
    d = input()
    a = list(map(int, input().split()))
    for j in a:
        if j in sunuke:
            sunuke.remove(j)
print(len(sunuke))

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

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

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

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

candidates = set(range(1,N+1))

for k in range(K):
  input()
  D = set(int(x) for x in input().split(' '))
  candidates -= D
  
  

print(len(candidates))

Solution (Python):
N, K = map(int,input().split())
dd = [True]*N
for i in range(K):
  di = int(input())
  AA = list(map(int,input().split()))
  
  for j in range(di):
    dd[AA[j]-1] = False
print(sum(dd))

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

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

Solution (Python):

from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor

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

    s = set(range(1, N+1))
    for k in range(K):
        d = int(input())
        As = list(map(int, input().split()))
        for a in As:
            if a in s:
                s.remove(a)

    print(len(s))

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np
import math
import scipy as sp
import queue
import collections

MOD = 10 ** 9 + 7
INF = 10 ** 9

def main(kwargs):
    n = kwargs["n"]
    k = kwargs["k"]
    D = kwargs["D"]
    A = kwargs["A"]
    C = [0 for i in range(n)]

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

    res = 0

    for i in range(n):
        if C[i] == 0:
            res += 1

    return res

if __name__ == "__main__":
    kwargs = {}

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

    kwargs["D"] = []
    kwargs["A"] = []

    for i in range(kwargs["k"]):
        cin = input().split()
        
        
        d = [int(i) for i in cin][0]
        
        kwargs["D"].append(d)

        cin = input().split()
        
        
        
        a = [int(i) for i in cin]
        kwargs["A"].append(a)

    cout = main(kwargs)
    print(cout)

Solution (Python):
n,k =list(map(int,input().split()))
ch = [0]*n
for i in range(k):
    x = int(input())
    c = list(map(int,input().split()))
    for s in c:
        ch[s-1]+=1
print(ch.count(0))

Solution (Python):
n,k=(int(i) for i in input().split())
l=[1 for i in range(1,n+1)]
for i in range(k):
  d=input()
  l1=[int(j) for j in input().split()]
  for j in l1:
      l[j-1]=0
c=0
for i in l:
  if(i>0):
    c+=1
print(c)

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

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

Solution (Python):

def q2():
    n, k = [int(i) for i in input().split(" ")]
    snk = set()
    for i in range(k):
        _ = int(input())
        l = [int(i) for i in input().split(" ")]
        for j in l:
            snk.add(j)
    print(n - len(snk))

q2()

Solution (Python):
N, K = input().split(" ")
N, K = int(N), int(K)
d = []
A = []
for k in range(K):
    d.append(int(input()))
    A += [int(a) for a in input().split(" ")]

ans = 0
for n in range(N):
    if A.count(n+1) == 0:
        ans += 1
print(ans)

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

total_list = []

for i in range(k):
    total_list += a[i]

uni = set(total_list)
ans = n - len(uni)

print(ans)

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

ans=0
for ss in sunuke:
  if ss==0:
    ans+=1
print(ans)

Solution (Python):
def n0():return int(input())
def n1():return [int(x) for x in input().split()]
def n2(n):return [int(input()) for _ in range(n)]
def n3(n):return [[int(x) for x in input().split()] for _ in range(n)]

n,k=n1()
tmp=n3(k*2)
d=tmp[::2]
A=tmp[1::2]

a=[]
for line in A:
    a.extend(line)
print(n-len(set(a)))

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

for j in a:
    for k in j:
        aa[k-1]+=1
        
ans=0

for x in aa:
    if x==0:
        ans+=1

print(ans)

Solution (Python):
import sys
n, k = map(int, sys.stdin.readline().split())
s = set()
for _ in range(k):
  d = int(sys.stdin.readline())
  li = list(map(int, sys.stdin.readline().split()))
  for i in li:
    s.add(i)
print(n-len(s))

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

a_new=set(sum(a, []))

b=[]
for i in range(n):
    b.append(i+1)
b_new=set(b)

print(len(b_new-a_new))

Solution (Python):
def main():

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

    Z = set()

    for _ in range(K):
        _ = int(input())
        Ad = map(int, input().split())

        Z |= set(Ad)

    print(N - len(Z))


main()

Solution (Python):

import sys
from collections import Counter
from itertools import permutations, combinations

from math import gcd
from math import ceil, floor
import bisect
sys.setrecursionlimit(10 ** 6)
inf = float("inf")

def input():
    return sys.stdin.readline()[:-1]

def main():
    n, k = map(int, input().split())
    d = [None] * k
    A = [None] * k
    for i in range(k):
        d[i] = int(input())
        A[i] = map(int, input().split())

    N = [True] * n
    for i in range(k):
        for a in A[i]:
            N[a-1] = False
    print(sum(N))

if __name__ == '__main__':
    main()

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

cnt=0
for flag in check:
    if not flag:
        cnt+=1

print(cnt)

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

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

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

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

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

Solution (Python):
N, K = map(int, input().split())
okashi_set = set([])
for i in range(K):
    d_i = int(input())
    A_d = list(map(int, input().split()))
    for A_d_j in A_d:
        okashi_set.add(A_d_j)
print(N-len(okashi_set))

Solution (Python):
import sys

if __name__ == '__main__':
    n, k = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    lst = [0 for i in range(n)]
    for i in range(k):
        d = int(sys.stdin.readline())
        p = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
        for i in p:
            lst[i-1] += 1
    print(sum([1 if x == 0 else 0 for x in lst]))

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

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

a = set(a)
ans = 0

for i in range(1, n+1):
    if i not in a:
        ans += 1

print(ans)

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

ans = [1] * n

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

    for i in a:
        ans[i-1] = 0

print(sum(ans))

Solution (Python):
N, K = map( int, input().split() )
            
A = list()
for kk in range(K):
    dk = int( input() )
    Ak = [ int(x) for x in input().split() ]
    for ak in Ak:
        A.append(ak)

L = len(set(A))
print(N-L)

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

D = [0] * N
for k in A:
    for i in k:
        D[i-1] += 1
res = 0
for i in D:
    if i == 0:
        res += 1
print(res)

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

Solution (Python):
import sys
N,K=map(int, sys.stdin.readline().split())
L=[ 1 for _ in range(N+1)]
L[0]=0
for _ in range(K):
    d=int(sys.stdin.readline().strip())
    A=map(int, sys.stdin.readline().split())
    for a in A:
        L[a]=0
print sum(L)

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

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

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

    for j in range(d):
        a[b[j]]=1

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

Solution (Python):
n,k=map(int,input().split())
a=[[] for ii in range(n+1)]
for i in range(k):
    d=int(input())
    b=list(map(int,input().split()))
    for x in b:
        a[x].append(i)
cnt=0
for i in a:
    if len(i)==0:
        cnt += 1
print(cnt-1)

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

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

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

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

ans = 0
for sunuke in table:
    if sunuke == 0:
        ans += 1

print(ans)

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

s = set()
for i in range(K):
    d = int(input())
    a_list = list(map(int, input().split()))
    for a in a_list:
        s.add(a)


print(N - len(s))

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

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

print(A.count(0))

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

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

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

print(n-len(li))

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

Solution (Python):
def main():
    n, k = map(int, input().split())
    d = [0] * k
    a = [0] * k
    ans = [i for i in range(1, n +1)]
    A = set()
    for i in range(k):
        d[i] = int(input())
        A |= set(map(int, input().split()))
    for i in A:
        ans.remove(i)
    print(len(ans))


if __name__ == '__main__':
    main()

Solution (Python):

import sys
sysread = sys.stdin.readline

def run():
    N,K = map(int, sysread().split())
    d = []
    A = []
    for i in range(K):
        d.append(int(sysread()))
        A.append(list(map(int, sysread().split())))
    persons = [False] * (N + 1)
    for a in A:
        for k in a:
            persons[k] = True
    print(persons[1:].count(False))

if __name__ == "__main__":
    run()

Solution (Python):
from collections import Counter
def main():
    N, K = [int(x) for x in input().split()]
    counter = Counter()
    for _ in range(K):
        _ = input()
        counter += Counter([int(x) for x in input().split()])

    ans = 0
    for x in range(1, N+1):
        if counter[x] == 0:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()