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

s={i for i in range(a,a+W+1)}&{i for i in range(b,b+W+1)}

if s:

  print((0))

else:

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

a, b = (a, b) if a<b else (b, a)

print((0 if a<=b<=a+W or b<=a<=b+W else min(abs(b-(a+W)), abs(a-(b+W)))))
W, a, b = list(map(int, input().split()))
s = {i for i in range(a, a + W + 1)} & {i for i in range(b, b + W + 1)}
if s:
    print((0))
else:
    print((min(abs(b - a - W), abs(b + W - a))))

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

-s = {i for i in range(a, a + W + 1)} & {i for i in range(b, b + W + 1)} -if s: -    print((0)) -else: -    print((min(abs(b - a - W), abs(b + W - a)))) +a, b = (a, b) if a < b else (b, a) +print( +    ( +        0 +        if a <= b <= a + W or b <= a <= b + W +        else min(abs(b - (a + W)), abs(a - (b + W))) +    ) +)