import Data.List
import Data.List.Split
import Data.Maybe
import qualified Data.ByteString.Char8 as B
readInt = fst . fromJust . B.readInt
main = mapM_ (print . solve) . chunksOf 2 . map (map readInt. B.words) . B.lines =<< B.getContents
solve [_,as] = (\x->((x+1)`div`2)*2-1) . length . group . sort $ as