import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )
import Data.List

cReadLn :: IO Int
cReadLn = fst . fromJust . C.readInt <$> C.getLine

getParms :: IO [Int]
getParms = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

main :: IO ()
main = do
  n  <- cReadLn
  as <- getParms
  let ii@(i:is) = f as
  print $
    if (head i) == 1 
      then ((length i)  `div` 2) + 1 + sum (map length is)
      else sum (map length ii)

f as = group . sort . map length . group . zipWith (<) as . tail $ as

count :: [Int] -> Int
count = h 0
  where
    h :: Int -> [Int] -> Int
    h s [] = s
    h s (1:1:is) = h (s+1) is
    h s (j:js)   = h (s+1) js