import Data.List

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

sol = length . f . sort

f [] = []
f (a:as) = if a `elem` as then f as' else a:f as'
  where
  as' = filter ((>0) . (`rem` a)) as