{-# LANGUAGE OverloadedLists #-}

import qualified Data.ByteString.Char8 as B
import qualified Control.Foldl as L

main :: IO ()
main = do
  as <- map (maybe (error "parse error") fst . B.readInt) . B.words <$> B.getLine
  print $ ((-) <$> L.maximum <*> L.minimum) as
