import Data.List
import Data.Ord

solve :: String -> String
solve [] = ""
solve (x:xs)
  | x == '1' = '9' : solve xs
  | x == '9' = '1' : solve xs
  | otherwise = x : solve xs

main :: IO ()
main = do
  line <- map read . words <$> getLine
  let [a, b, c] = sortOn Down line
  print $ a * 10 + b + c