import qualified Data.ByteString.Char8 as BS
import           Data.List
import qualified Data.Set              as S
import           Data.Maybe

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words

getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

unDiv :: [Integer] -> Int
unDiv xs
  | null cnt   = 0
  | otherwise  = length $ S.difference (S.fromList xs) cnt
  where
    -- xsSet = S.toList $ S.fromList xs
    ma    = maximum xs
    uniq  = S.toList $ S.fromList xs
    cnt   = S.fromList $ [cnt | el <- uniq, cnt <-[el*2,el*3..ma]]

main :: IO ()
main = do
  getLine
  as <- getIntList
  print $ unDiv as
