import Data.List(sort)
main = do
    a <- map read . words <$> getLine :: IO [Int]
    print $ read (f2 a) + last (f a)
        where f = reverse . sort
              f2 a = let (b:c:_) = init (f a) in show b ++ show c