
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE BangPatterns #-}

module Main where

import Debug.Trace
import qualified Data.Map.Strict as Map

main :: IO ()
main = do
  getLine
  s <- map read . words <$> getLine 
  --a `traceShow`
  print $ solve s

solve :: [Int] -> Int
solve s = length . filter (\ss -> (Map.findWithDefault 0 ss t) == 1) $ s
  where
    mx = (maximum s) + 1
    t = build mx Map.empty s

type Table = Map.Map Int Int

build :: Int -> Table -> [Int] -> Table
build mx t [] = t
build mx t (s:ss) = build mx t' ss
  where
    t' = if (Map.findWithDefault 0 s t) > 0 then Map.insertWith (+) s 1 t else foldr (\a tt -> Map.insertWith (+) a 1 tt) t [s, s*2 .. mx]
