local n=io.read("n")
local a={}
local a_map={}
for i=1,n do
    local input=io.read("n")
    a[i]=input
    a_map[input]=(a_map[input] or 0)+1
end

local counter=0
for i=1,n do
    local checker=true
    a_map[a[i]]=a_map[a[i]]-1
    for j=1,math.sqrt(a[i]) do
        local div=math.floor(a[i]/j)
        local ce=(a_map[j] and a_map[j]>0) or (a_map[div] and a_map[div]>0)
        if a[i]%j==0 and ce then
            checker=false
            break
        end
    end
    if checker then
        counter=counter+1
    end
    a_map[a[i]]=a_map[a[i]]+1
end
print(counter)