N=io.read("n")
local a={}
local t={}
for i=1,N do
  a[i]=io.read("n")
  t[a[i]]=(t[a[i]] or 0)+1
end
local count=0
for i,v in pairs(t) do
  if i<v then
    count=count+v-i
    elseif i>v then
      count=count+v
  end
end
print(count)