import Data.List

main = interact $ show . sol . map read . tail . words

sol = length . f . concat . filter ((==1) . length) . group . sort

f [] = []
f (a:as) = if a*2>last as 
  then a:as
  else a:f (filter ((>0) . (`rem` a)) as)