import Control.Applicative
import Data.List

main :: IO ()
main = do
    ns <- map read . words <$> getLine
    putStrLn $ show (solve (sort ns))
    
solve :: [Int] -> Int
solve ns = ns !! 1 - ns !! 0 + ns !! 2 - ns !! 1 