import Control.Monad.State
import Control.Arrow
import Data.List

getInts = map read . words <$> getLine :: IO [Int]

data Coins = Coins {_a::Int,_b::Int,_c::Int}

sumStr = map (\x -> read [x]) >>> foldr1 (+)

main = do
    arr <- getLine >> getInts
    putStrLn . show $ game (sort >>> reverse $ arr) 0
    where 
        game [] a  =  a
        game (x:[]) a = a + x
        game (x:y:arr_) a = game arr_ (a + x - y)