n = io.read("*n")
t = {}
for i = 1, n do
  a = io.read("*n")
  if t[a] then t[a] = t[a] + 1 else t[a] = 1 end
end
r = 0
for k, v in pairs(t) do
  if k <= v then
    r = r + v - k
  else
    r = r + v
  end
end
print(r)