import Control.Applicative ((<$>)) import Control.Monad (replicateM) import Data.List (sort, group, maximumBy) import Data.Function (on) main :: IO () main = do n <- readLn solve <$> replicateM n getLine >>= print solve :: [String] -> Int solve = head . maximumBy (compare `on` length) . group . sort . map ((subtract 2) . length)