import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
    ns <- sort . map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
    print . head . sort . map f $ permutations ns
    
f [a, b, c] = abs (b - a) + abs (c - b)
