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

aw = a + w

bw = b + w

if a < aw < b < bw:

    print((b-aw))

elif b < bw < a < aw:

    print((a-bw))

else:

    print((0))

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



if a <= a + w <= b <= b + w:

    print((b - a - w))

elif a <= b <= a + w <= b + w:

    print((0))

elif b <= a <= a + w <= b + w:

    print((0))

elif b <= b + w <= a <= a + w:

    print((a - b - w))

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

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

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