AtCoDeer the deer found two rectangles lying on the table, each with height 1 and width W.
If we consider the surface of the desk as a two-dimensional plane, the first rectangle covers the vertical range of [0,1] and the horizontal range of [a,a+W], and the second rectangle covers the vertical range of [1,2] and the horizontal range of [b,b+W], as shown in the following figure:

AtCoDeer will move the second rectangle horizontally so that it connects with the first rectangle.
Find the minimum distance it needs to be moved.

-----Constraints-----
 - All input values are integers.
 - 1≤W≤10^5
 - 1≤a,b≤10^5

-----Input-----
The input is given from Standard Input in the following format:
W a b

-----Output-----
Print the minimum distance the second rectangle needs to be moved.

-----Sample Input-----
3 2 6

-----Sample Output-----
1

This input corresponds to the figure in the statement. In this case, the second rectangle should be moved to the left by a distance of 1.

Difficulty: introductory

Starter code:

Solutions:
W,a,b=map(int,input().split());print([abs(a-b)-W,0][abs(a-b)<=W])

a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
if b<=c:
  if a+b>=c:
    print(0)
  else:
    print(c-b-a)
else:
  if a+c>=b:
    print(0)
  else:
    print(b-c-a)

w,a,b = map(int, input().split())
print(max(0,b-a-w) if b >= a else max(0,a-b-w))

#!/usr/bin/env python3
W, a, b = list(map(int, input().split()))

a_l = a
a_r = a + W
b_l = b
b_r = b + W

if b_r < a_l:
    print((abs(b_r - a_l)))
elif a_r < b_l:
    print((abs(a_r - b_l)))
else:
    print((0))


w,a,b=map(int,input().split())
if b>=a+w:
    print(b-a-w)
else:
    if b+w>=a:
        print('0')
    else:
        print(a-b-w)

w, a, b = map(int, input().split())
print(max(abs(a-b)-w,0))

w, a, b = map(int, input().split())
if a <= b:
    if a+w < b:
        print(b-a-w)
    else:
        print(0)
else:
    if b+w < a:
        print(a-b-w)
    else:
        print(0)

w, a, b = list(map(int, input().split()))
if abs(a - b) <= w:
  print((0))
else:
  print((abs(a -b) - w))


w, a, b = map(int, input().split())

if a + w < b:
  print(b - (a + w))
elif b + w < a:
  print(a - (b + w))
else:
  print(0)

w, a, b = map(int, input().split())

if a+w < b:
    ans = b-(a+w)
elif b+w < a:
    ans = a-(b+w)
else:
    ans = 0

print(ans)

W,a,b = map(int,input().split())
print(max(0,b-(a+W),a-(b+W)))

w,a,b = map(int,input().split())
if a <= b <= a+w or a <= b+w <= a+w:
  print(0)
else:
  print(min(abs(a+w-b),abs(b+w-a)))

#!/usr/bin/env python3
import sys


def solve(W: int, a: int, b: int):
    if abs(a-b) <= W:
        return 0
    return abs(a-b) - W

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    print((solve(W, a, b)))

def test():
    import doctest
    doctest.testmod()

def __starting_point():
    #test()
    main()

__starting_point()

#!/usr/bin/env python3
w,a,b=map(int,input().split())
if b>a:
    if b-w-a>0:
        print(b-w-a)
    else:
        print(0)
if a>b:
    if a-w-b>0:
        print(a-w-b)
    else:
        print(0)
if a==b:
    print(0)

W,a,b=map(int,input().split())
if b+W<a :
  print(a-(b+W))
elif a+W<b :
  print(b-(a+W))
else :
  print(0)

W, a, b = map(int, input().split())
f = lambda x:x if x > 0 else 0
print(f(abs(a-b)-W))

w, a, b = map(int, input().split())
print(max(0, b - a - w, a - b - w))

W, a, b = list(map(int, input().split()))

if a + W < b:
    print((b - (a + W)))
elif a > b + W:
    print((a - (b + W)))
else:
    print((0))


w,a,b = map(int, input().split())

if a <= b <= a + w or a <= b + w <= a + w:
  print(0)
elif a + w < b:
  print(b - (w + a))
elif b + w < a:
  print(a - (w + b))

w,a,b=map(int,input().split())
if a<b:
  if a+w>b:
    print(0)
  else:
    print(b-a-w)
elif b<a:
  if b+w>a:
    print(0)
  else:
    print(a-b-w)
else:
  print(0)

import sys

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def main():
    w, a, b = MI()
    if b < a:
        temp = a
        a = b
        b = temp
    ans = max(0, b-a-w)
    print(ans)


def __starting_point():
    main()
__starting_point()

w,a,b = map(int,input().split())
if abs(a - b) <= w:
    print(0)
else:
    print(abs(a - b) - w)

lst = input().split()

W = int(lst[0])
a = int(lst[1])
b = int(lst[2])

if b-W <= a <= b+W:
   print(0)
else:
   print(max([b - (a + W), a - (b + W)]))

w,a,b = (int(T) for T in input().split())
if a+w<b:
    print(b-(a+w))
elif a<=b<=a+w:
    print(0)
else:
    print(a-(b+w))

w, a, b = list(map(int, input().split()))
if b + w < a:
    res = a - (b + w)
elif a <= b + w <= a + 2 * w:
    res = 0
else:
    res = b - (a + w)

print(res)


W, a, b = map(int, input().split())

if abs(b - a) - W <= 0:
    print(0)
else:
    print(abs(b - a) - W)

W, a, b = list(map(int, input().split()))

if abs(a - b) <= W:
    print(0)
else:
    print(abs(a - b) - W)

W, a, b = list(map(int, input().split()))

if a <= b <= a + W or a <= b + W <= a + W:
    print((0))
else:
    print((min(abs(a + W - b), abs(b + W - a))))


W, a, b = list(map(int, input().split()))

if a + W < b:
    print((abs(a + W - b)))
elif b + W < a:
    print((abs(b + W - a)))
else:
    print((0))


w, a, b = list(map(int, input().split()))

if a <= b <= a+w  or b <= a <= b+w:
    ans = 0
elif a < b:
    ans = b-a-w
else:
    ans = a-b-w

print(ans)


W,a,b = map(int,input().split())
if a-W <= b <= a+W:
    print(0)
elif b+W < a:
    print(a-(b+W))
else:
    print(b-(a+W))

W,a,b = map(int, input ().split ())
if a < b:
  A,B = W+a,b
  if A >= B:
    print (0)
  else:
    print (B-A)
else:
  A,B = a,W+b
  if B >= A:
    print (0)
  else:
    print (A-B)

w, a, b = map(int, input().split())
ans = max(a, b) - min(a+w, b+w)
print(max(ans, 0))

W, A, B = [int(i) for i in input().split()]

if B <= A <= B+W or B <= A+W <= B+W or A <= B <= A+W or A <= B+W <= A+W:
  print((0))
elif W + A <= B:
  print((B - (W + A)))
else:
  print((A - (B + W)))


w, a, b = map(int, input().split())
if a <= b:
    if a + w >= b:
        print(0)
    else:
        print(b - a - w)
else:
    if b + w >= a:
        print(0)
    else:
        print(a - b - w)

w,a,b = map(int,input().split())
if a+w < b:
    print(b-a-w)
elif b+w < a:
    print(a-b-w)
else:
    print(0)

W, a, b = map(int, input().split())
L = [b - (a + W), a - (b + W), 0]
print(max(L))

w,a,b=map(int,input().split())
if a>b:a,b=b,a
print(max(0,b-a-w))

w, a, b = map(int, input().split())

if abs(a - b) < w:
  print(0)
else:
  print(abs(a - b) - w)

w, a, b = map(int,input().split())
if a > b:
    a, b = b, a

print(max(b - a - w, 0))

W,a,b =list(map(int,input().split()))
if b>=a:
    if b-(a+W)<0:print((0))
    else:print((b-(a+W)))
else :
    if a-(b+W)<0:print((0))
    else:print((a-(b+W)))
        


w,a,b=map(int,input().split())

if a<=b:
  if a+w<b:
    print(b-a-w)
  else:
    print(0)
    
else:
  if b+w<a:
    print(a-b-w)
  else:
    print(0)

# import math
# import statistics
# import itertools
# a=int(input())
# b=input()
# c=[]
# for i in a:
#     c.append(int(i))
W,a,b= list(map(int,input().split()))
# f = list(map(int,input().split()))
# g = [int(input()) for _ in range(N)]
# h = []
# for i in range(a):
#     h.append(list(map(int,input().split())))
# a = [[0] for _ in range(H)]#nizigen

ans1=b-(a+W)
ans2=a-(b+W)

if a+W<b or b+W<a:
    print((min(abs(ans1),abs(ans2))))
else:
    print((0))


w,a,b=map(int,input().split())
if len(sorted(set(range(a,a+w+1)) & set(range(b,b+w+1)))) !=0:
  print("0")
elif b>=a+w:
  print(b-a-w)
elif a>=b+w:
  print(a-b-w)

w,a,b = map(int, input().split())
print(max(abs(a-b)-w,0))

w, a, b = map(int, input().split())
if abs(a - b) < w:
    ans = 0
else:
    ans = abs(a - b) - w
print(ans)

W,a,b=map(int,input().split())
print(max(0,b-a-W,a-b-W))

W, a, b = list(map(int, input().split()))

if (a <= b <= a + W) or (a <= b + W <= a + W):
    print((0))
    return

if a + W < b:
    print((b - (a + W)))
    return
else:
    print((a - (b + W)))


W,a,b=list(map(int,input().split()))
print((max(abs(a-b)-W,0)))


import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

w, a, b = rm()
if a < b:
    print((max(b-(a+w), 0)))
else:
    print((max(a-(b+w), 0)))













w,a,b=map(int,input().split())
if abs(a-b) <= abs(w):
  print(0)
else:
  print(abs(a-b)-w)

w, a, b = list(map(int, input().split()))
if a+w < b:
    print((b-a-w))
elif b+w < a:
    print((a-b-w))
elif a <= b <= a+w:
    print((0))
else:
    print((0))


w,a,b=map(int,input().split())
A=[i for i in range(a,a+w+1)]
B=[i for i in range(b,b+w+1)]
if a in B or b in A:
    print(0)
else:
    print(min(abs(a+w-b),abs(b+w-a)))

w,a,b = map(int,input().split())

min_side = min(a,b)
max_side = max(a,b)

t = max_side - (min_side + w)
t = max(t,0)

print(t)

w,a,c=map(int,input().split())

b=w+a
d=w+c

if a>c:
  if a>d:
    print(abs(d-a))
  else:
    print('0')

else:
  if c>b:
    print(abs(c-b))
  else:
    print('0')

W,a,b=map(int, input().split())

dis = max(0, abs(a-b)-W)
print(dis)

w,a,b = map(int, input().split())
if b >= a:
    print(max(0,b-(a+w)))
else:
    print(max(0,a-(b+w)))

#!/usr/bin/env python3
import sys


def solve(W: int, a: int, b: int):
    if a <= b <= a+W or b <= a <= b+W:
        return 0
    return min(min(abs(aa-bb) for bb in [b, b+W]) for aa in [a, a+W])

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  # type: int
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    print((solve(W, a, b)))

def test():
    import doctest
    doctest.testmod()

def __starting_point():
    #test()
    main()

__starting_point()

w, a, b = map(int, input().split())

if b > a + w:
    print(b - a - w)
elif b + w < a:
    print(a - b - w)
else:
    print(0)

w,a,b = map(int, input().split())

if (a <= b <= a+w) or (a <= b+w <= a+w):
    print(0)
elif a+w < b:
    print(b-a-w)
elif b+w < a:
    print(a-b-w)

w,a,b = map(int,input().split())
aw = a + w
bw = b + w
if a == bw or b == aw or a == b:
    print(0)
elif a < b < aw or b < a < bw:
    print(0)
else:
    if aw < b:
        print(b-aw)
    if bw < a:
        print(a-bw)

import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10**9)
MOD = 10**9 + 7
#MOD = 998244353


def si(): return input()
def ii(): return int(input())
def fi(): return float(input())
def lstr(): return input().split()
def lint(): return list(map(int, input().split()))
def lint_dec(): return list(map(lambda x:int(x) - 1, input().split()))
def lnstr(n): return [input() for _ in range(n)]
def lnint(n): return [int(input()) for _ in range(n)]
def lint_list(n): return [lint() for _ in range(n)]



############################################################
W, a, b = lint()
print(max(0, max(a, b) - min(a, b) - W))

w,a,b = map(int,input().split())
#print(w,a,b)
if a+w < b:
  print(abs(b-(a+w)))
elif b+w < a:
  print(abs(a-(b+w)))
else:
  print(0)

w, a, b = list(map(int, input().split()))
res = max(0, abs(a - b) - w)
print(res)


def answer(w: int, a: int, b: int) -> int:
    b_a = abs(b - a)
    if b_a <= w:
        return 0
    return b_a - w


def main():
    w, a, b = map(int, input().split())
    print(answer(w, a, b))


def __starting_point():
    main()
__starting_point()

w, a, b = map(int, input().split())
print(0) if a+w >= b and b+w >= a else print(b-a-w) if a+w < b else print(a-b-w)

w,a,b = [int(x) for x in input().split()]
a,b = min(a,b) ,max(a,b)

print(max(0,b-a-w))

W, a, b = list(map(int, input().split()))

print((max(abs(b-a)-W, 0)))


w, a, b = map(int, input().split())

if a + w < b:
  print(abs(b - (a+w)))
elif b + w < a:
  print(abs(a - (b+w)))
else:
  print(0)

# B - NarrowRectanglesEasy
def main():
    W, a, b = map(int, input().split())

    if a > b:
        print(max(0, a-b-W))
    else:
        print(max(0, b-a-W))
        
def __starting_point():
    main()
__starting_point()

w, a, b = map(int, input().split())
if a <= b:
    print(b - w - a if b - w - a > 0 else 0)
else :
    print(a - w - b if a - w - b > 0 else 0)

W, a, b = map(int, input().split())
if abs(a-b) < W:
    ans = 0
else:
    ans = abs(a-b) - W
print(ans)

w,a,b = list(map(int,input().split()))
ans = 0
if a+w<b:
    ans = b-(a+w)
elif b<a:
    ans = a-(b+w)
else:
    ans = 0
print(ans)


w,a,b=map(int,input().split())
if a<=b:
  print(max(0,b-(a+w)))
else:
  print(max(0,a-(b+w)))

w,a,b=map(int,input().split())
#a,a+w b,b+w
if b<=a<=b+w or a<=b<=a+w:
  print(0)
else:
  print(min(abs(b-a-w),abs(b+w-a)))

W,a,b=map(int,input().split())
if a>b:
    if a<=b+W:
        print('0')
    else :
        print(a-b-W)
elif b>a:
    if b<=a+W:
        print('0')
    else :
        print(b-a-W)
else:
    print('0')

w, a, b = map(int, input().split())
if a <= b <= a+w or b <= a <= b+w:
    print("0")
elif a+w < b:
    print(b-(a+w))
else:
    print(a-(b+w))

W, a, b = list(map(int, input().split()))
if b+W < a:
    print((a-(b+W)))
elif b > a+W:
    print((b-(a+W)))
else:
    print((0))


w,a,b=list(map(int,input().split()))
if a<b:
    print((b-a-w if b-a-w>0 else 0))
else:
    print((a-b-w if a-b-w>0 else 0))


#n = int(input())
w, a, b = list(map(int, input().split()))
#l = list(map(int,input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

if a <= b:
    ans = max(0, b-(a+w))
else:
    ans = max(0, a-(b+w))
print(ans)


w,a,b = map(int,input().split())
if b>=a:
  print(max(0,b-(a+w)))
else:
  print(max(0,a-(b+w)))

w,a,b = map(int,input().split())
if a+w < b:
    print(b-(a+w))
elif b+w < a:
    print(a-(b+w))
else:
    print(0)

W,a,b=map(int,input().split())
ans=0
if a+W<b:
    ans=b-(a+W)
elif b+W<a:
    ans=a-(b+W)
print(ans)

w, a, b = map(int, input().split())

print(max(a, b) - min(a, b) - w) if abs(a -  b) > w else print(0)

w,a,b = map(int,input().split())
aw = a+w
bw =b+w
print(max(0,a-bw,b-aw))

W,a,b=map(int,input().split())
print(max(0,b-a-W,a-b-W))

w, a, b = list(map(int, input().split()))
if a + w < b:
  print((b - (a + w)))
elif b + w < a:
  print((a - (b + w)))
else:
  print((0))


w,a,b = map(int,input().split())
n = max(a,b)-(min(a,b)+w)
if n < 0:
    print(0)
else:
    print(n)

w, a, b = list(map(int, input().split()))
ans = abs(a - b) - w
print(ans) if ans > 0 else print(0)

W,a,b=list(map(int,input().split()))
print(0 if W>abs(a-b) else abs(a-b)-W)

w, a, b = map(int, input().split())
l = max(a, b) - min(a, b)
print(l - w if l > w else 0)

w,a,b=map(int,input().split())
if a<b:
  if a+w<b:
    print(b-a-w)
  else:
    print(0)
elif a>b:
  if b+w<a:
    print(a-b-w)
  else:
    print(0)
else:
  print(0)

w,a,b=map(int,input().split())
if b<=a+w<=b+w or b<=a<=b+w:
    print(0)
else:
    print(min(abs(a+w-b),abs(b+w-a)))

W, A, B = map(int, input().split())
print(max(abs(B-A)-W, 0))

W, a, b = list(map(lambda x: int(x), input().split(" ")))
m = min([a,b])
M = max([a,b])

if M - m > W:
  print(M - m - W)
else:
  print(0)

w, a, b = map(int, input().split())

if a + w < b:
    print(b - a - w)
elif  a < b + w:
    print(0)
else:
    print(a - b - w)

w,a,b=map(int,input().split())
if ((a<=b and b<=a+w) or (a<=b+w and b<=a)):
    print(0)
elif a+w<b:
    print(b-a-w)
else:
    print(a-b-w)

W,a,b=map(int,input().split())
if b>a:
  if b-(a+W)<=0:
  	print(0)
  	return
  print(b-(a+W))
else:
  if a-(b+W)<=0:
  	print(0)
  	return
  print(a-(b+W))

#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


W,a,b = list(map(int, input().split()))

if (b+W < a):
    print((a-(b+W)))
elif (a+W < b):
    print((b-(a+W)))
else:
    print((0))