module Main where

import Control.Applicative
import Control.Monad
import Data.List (sort)

main :: IO ()
main = do
    as <- sort . fmap read . words <$> getLine :: IO [Int]
    let bs = zipWith (-) (tail as) as
    print $ sum bs