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
        if a[i]%j==0 and (a_map[j] and a_map[j]>0) then
            checker=false
        end
    end
    if checker then
        counter=counter+1
    end
    a_map[a[i]]=a_map[a[i]]+1
end
print(counter)