import           Control.Monad
import           Control.Applicative
import           Data.IORef
import           Data.List.Split
import           Data.Maybe
import           Data.List

main :: IO ()
main = do
  [w, a, b] <- map read . words <$> getLine
  print $ solve (a, a + w) (b, b + w)

solve (as, ag) (bs, bg)
  | (as <= bs && bs <= ag) || (as <= bg && bg <= ag) = 0
  | otherwise = minimum $ map abs [as - bs,as - bg, ag - bs, ag - bg]