Problem:
 Score : 200 points    Problem Statement 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 1 3 2 6      Sample Output 1 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 .       Sample Input 2 3 1 3      Sample Output 2 0  The rectangles are already connected, and thus no move is needed.       Sample Input 3 5 10 1      Sample Output 3 4

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

Solution (Python):
N = [int(e) for e in input().split()]
if(N[2]+N[0] <= N[1]):
    ans = N[1] - (N[2]+N[0])
else:
    ans = N[2] - (N[1]+N[0])
if(ans > 0):
    print(ans)
else:
    print(0)

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

W, a, b = MAP()
print(max(0, b-a-W, a-b-W))

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

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

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

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

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

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

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

Solution (Python):
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)

Solution (Python):
import math

def makelist(n, m):
    return [[0 for _ in range(m)] for _ in range(n)]


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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7


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

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
W, a, b = map(int, input().split())
if(a > b):
  [a,b] = [b,a]

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

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

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

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

Solution (Python):
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))
else:
    print(a-(b+W))

Solution (Python):
W, a, b = map(int,input().split())
print(0 if max(a,b)-W-min(a,b)<0 else max(a,b)-W-min(a,b))

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

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

Solution (Python):
w,a,b=map(int,input().split())
x=min(a,b)
y=max(a,b)
print(y-x-w if y-x>w else 0)

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

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

Solution (Python):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

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

Solution (Python):
def resolve():
    W, a, b = list(map(int, input().split()))
    res = 0
    if a > b + W:
        res = a - (b + W)
    elif b > a + W:
        res = b - (a + W)
    print(res)



if '__main__' == __name__:
    resolve()

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

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

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

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

Solution (Python):

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

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

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

Solution (Python):
W, a, b = map(int, input().split())
if b>a+W:
    print(abs(b-a-W))
elif a+W>=b>=a:
    print(0)
elif a>b:
    print(a-b-W)

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

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

Solution (Python):
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)

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, a, b = il()
    print(max(0, b - (a + W), a - (b + W)))


if __name__ == '__main__':
    main()

Solution (Python):

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

print(a - (b + x) if a > b else max(0, b - (a + x)))

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

Solution (Python):
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)

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

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

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

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

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

Solution (Python):
x, y, z = map(int,input().split())
ans = abs(y-z)-x
print(ans) if ans > 0 else print(0)

Solution (Python):
def resolve():
	w, a, b = map(int, input().split())
	print(abs(a - b) - w if abs(a-b) > w else 0)
resolve()

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

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

Solution (Python):
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)

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

print(max(0,max(a,b)-(min(a,b)+W)))

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

A=min(a,b)

B=max(a,b)

if A+w<B:
  print(B-A-w)
else:
  print(0)

Solution (Python):

import sys


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


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    W = int(next(tokens))  
    a = int(next(tokens))  
    b = int(next(tokens))  
    print(solve(W, a, b))

if __name__ == '__main__':
    main()

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

if a > b:
    c = a
    a = b
    b = c

ans = b - (a+w)

if ans < 0:
    ans = 0

print(ans)

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

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    W, a, b, = il()
    if b <= a + W <= b + W or b <= a <= b + W:
        print(0)
        exit()

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


if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):
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)

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

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

Solution (Python):
w, a, b = map(int, input().split())
c = min(a, b)
d = max(a, b)
print(max(d-(c+w), 0))

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

Solution (Python):
W, a, b = map(int,input().split())
if a > b:
    a, b = b, a
print(max(0,b-(a+W)))

Solution (Python):
w,a,b = map(int,input().split())
x = max(a,b)
y = min(a,b)
if (x-y) > w:
  print((x-y)-w)
else:
  print(0)

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

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

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

Solution (Python):
n, m, k = map(int, input().split())
if m > k:
    m, k = k, m
print(max(0, k-(m+n)))

Solution (Python):
W, a, b = [int(x) for x in input().split()]

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

print (ans)

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

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

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

Solution (Python):
W, a, b = map(int, input().split())
if a > b:
    a, b = b, a

ans = max(0, b - (a + W))
print(ans)

Solution (Python):
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)

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

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

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

ans1=b-a-w
ans2=a-b-w

print(min(abs(ans1),abs(ans2)))

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

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

Solution (Python):

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

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

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

l = min([a, b])
r = max([a, b])

if l+W <= r:
    print(r-(l+W))
else:
    print(0)

Solution (Python):
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)

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

Solution (Python):
def main():
    W, a, b = map(int, input().split())

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    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)


if __name__ == "__main__":
    main()

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

A2W = (a, a+W)
B2W = (b, b+W)

if (A2W[0] <= B2W[0] and B2W[0] <= A2W[1]) or (A2W[0] <= B2W[1] and B2W[1] <= A2W[1]):
    print(0)
elif B2W[0] > A2W[1]:
    print(B2W[0]-A2W[1])
else:
    print(A2W[0]-B2W[1])

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

Solution (Python):

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)

Solution (Python):
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))
else:
    print(a-(b+w))

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

if a + w < b:
    ans = b - (a + w)
elif b + w >= a and a + w >= b:
    ans = 0
else:
    ans = a - (b + w)
print(int(ans))

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

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

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

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

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

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

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

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

if a+W<b:
  ans = b-a-W
elif a>b+W:
  ans = a-b-W
else:
  ans = 0

print(ans)

Solution (Python):
w, a, b = map(int,input().split())
s = abs(a-b)
print([0, s-w][s>w])

Solution (Python):
w,a,b=[int(i) for i in input().split()]

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

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

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

Solution (Python):


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

Solution (Python):

import math
import itertools
import statistics

import collections

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

a_end = a+w
b_end = b+w

if a_end < b:
    print(b-a_end)
elif (a <= b and b <= a_end) or (b <= a and a <= b_end):
    print(0)
else:
    print(a-b_end)

Solution (Python):
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)

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

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

Solution (Python):
w, a, b = map(int, input().split())
right = min(a, a+w, b, b+w)
left = max(a, a+w, b, b+w)

if 2 * w >= left - right:
    print(0)
else: 
    print(left - right - 2 * w)

Solution (Python):
w,a,b=map(int,input().split())
if a<b:
    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))

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

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

Solution (Python):
W, a, b = map(int, input().split())
result = 0
if ((a <= b) and (b <= a + W)) or ((a <= b + W) and (b + W <= a + W)):
  result = 0
elif (b + W < a):
  result = a - (b + W)
elif (a + W < b):
  result = b - (a + W)
print(result)

Solution (Python):
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)

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""




mod = 10**9+7



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

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

result = 0
if a < b :
    hantei = b - a - w
else:
    hantei = a - b - w 

for i in range(1,10**5):
    
    if hantei <= 0:
        print(result)
        exit()
    else:
        hantei -= 1
        result += 1

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

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

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

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

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

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

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

Solution (Python):
W, a, b = [int(i) for i in input().split()]

output = 0
if a < b:
    dist = b - (a+W)
    if dist > 0:
        output = dist
else :
    dist = a - (b+W)
    if dist > 0 :
        output = dist
        
print(output)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

w,a,b = iim()

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

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

Solution (Python):



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


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

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

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

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

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

Solution (Python):
w, a, b  = map(int, input().split())
if a <= b <= a+w or a <= b+w <= a+w:
    print(0)
else:
    res = float("inf")
    res = min(res, abs(b-(a+w)))
    res = min(res, abs(a-(b+w)))
    print(res)

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

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

if ans>0:
    print(ans)
else:
    print("0")

Solution (Python):
w, a, b = map(int, input().split())
al = a + w
bl = b + w
r = 0
if b >= a and b <= al:
	r = 0
elif bl >= a and bl <= al:
	r = 0
else:
	r = b - al if b > al else a - bl
print(r)

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

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

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

Solution (Python):
w, a, b = [int(i) for i in input().split()]
if a - b <= 0:
    ans = b - (a+w)
else:
    ans = a - (b+w)

print(ans if ans > 0 else 0)

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

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

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

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

aw = a+w
bw = b+w

if (a <= b <= aw) or (a <= bw <= aw):
  print(0)
elif b>a:
  print(b-aw)
else:
  print(a-bw)

Solution (Python):
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))

Solution (Python):

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))

Solution (Python):
W, a, b = map(int, input().split())
if b >= a:
  d = b - (a + W)
else:
  d = a - (b + W)

if d >= 1:
  print(d)
else:
  print(0)

Solution (Python):
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)

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

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

Solution (Python):
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)

Solution (Python):

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

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

else:
    print(abs(a - b) - W)

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

Solution (Python):
w,a,b = [int(x) for x in input().split()]

if b > a:
    print(max(0, b-(a+w)))
else:
    print(max(0, a-(b+w)))

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

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

Solution (Python):
from __future__ import print_function

import sys

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd



import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return


def lcm(n, m):
    return int(n * m / gcd(n, m))


def coprimize(p, q):
    common = fractions.gcd(p, q)
    return (p // common, q // common)


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):

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

Solution (Python):
W, a, b = map(int, input().split())
if min(a,b)+W >= max(a,b):
  print(0)
elif min(a,b)+W < max(a,b):
  print(max(a,b)-(min(a,b)+W))

Solution (Python):
W,a,b=map(int,input().split())
Max=max(a,b)
Min=min(a,b)

ans=Max-(Min+W)
if ans<0:
    ans=0
print(ans)

Solution (Python):
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)

Solution (Python):
w, a, b = [int(x) for x in input().split()]
if abs(a - b) <= w:
    res = 0
else:
    res = min(abs(a + w - b), abs(b + w - a))
print(res)

Solution (Python):
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)

Solution (Python):

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

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

if a <= b <= a + w or b <= a + w <= b + w or b <= a <= b+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)

Solution (Python):
w,a,b = map(int,input().split())
m = b-a-w
n = a-b-w
if m>0:
  print(m)
elif n>0:
  print(n)
else:
  print(0)

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

Solution (Python):








def resolve():
    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)



resolve()

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

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    W,a,b=MI()
    d1=max(0,b-(a+W))
    d2=max(0,a-(b+W))
    print(max(d1,d2))

main()

Solution (Python):











mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

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

A = a + W
if b > a:
    if b - A <= 0:
        print(0)
    else:
        print(b - A)
else:
    B = b + W
    if a - B <= 0:
        print(0)
    else:
        print(a-B)

Solution (Python):
W, a, b = map(int, input().split())
if a > b:
    a, b = b, a

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

Solution (Python):
W,a,b=map(int, input().split())
print(0 if W>=abs(b-a) else min(abs(b-a-W),abs(a-b-W)))

Solution (Python):
w,a,b = [int(i) for i in input().split()]
ans = 0
if a <= b <= a+w or b <= a <= b+w:
  print(ans)
else:
  ans = min(abs(b-a-w),abs(a-b-w))
  print(ans)

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

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

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

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

Solution (Python):
W,a,b=map(int,input().split())
if a<b:
    print(max(0,b-a-W))
else:
    print(max(0,a-b-W))

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