local mfl, mce = math.floor, math.ceil
local n = io.read("*n")
local a = {}
local t = {}
for i = 1, 1000 * 1000 do
  t[i] = 0
end
for i = 1, n do
  a[i] = io.read("*n")
end
local acmp = {}
for i = 1, n do
  local v = a[i]
  if not acmp[v] then acmp[v] = 1
  else acmp[v] = acmp[v] + 1
  end
end
for v, cnt in pairs(acmp) do
  local lim = mfl(1000000 / v)
  for j = 1, lim do
    t[j * v] = t[j * v] + cnt
  end
end
local c = 0
for i = 1, n do
  local v = a[i]
  if t[v] == 1 then
    c = c + 1
  end
end
print(c)
