import qualified Data.IntSet                   as S
import qualified Data.IntMap.Strict            as M
import           Control.Monad                  ( replicateM )
import qualified Data.Vector.Primitive         as V
import           Data.List                      ( foldl' )





main :: IO ()
main = do
    n <- readLn :: IO Int
    print
        .   foldl' (+) 0
        .   map toInteger
        .   M.elems
        .   V.foldl' (flip update) M.empty
        =<< V.replicateM n (foldl' (+) 0 . map fromEnum <$> getLine)
  where
    
    update = M.alter f

    f Nothing  = Just 0
    f (Just n) = Just (n + n + 1)
