local n=io.read("*n")
local a={}
for i=1,n do
    local number=io.read("*n")
    if not a[number] then
        a[number]=1
    else
        a[number]=a[number]+1
    end
end

local total=0
for i,j in pairs(a) do
    if i<j then
        total=total+j-i
    elseif i>j then
        total=total+j
    end
end
print(total)