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 in C++14 (GCC 5.4.1) (judge verdict: Accepted)

#include<bits/stdc++.h>
using namespace std;

// #define DEBUG
#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

#define EL cout<<endl

using LL = long long;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;
using Pdd = P<double,double>;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename T1,typename T2> using M = map< T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

const int MOD = 1000000007;
const int INF = 1999999999;
const LL INFLL = 999999999999999LL;
const double EPS = 1e-10;

const int DX[8]= {-1,0,1,0,-1,-1,1,1};
const int DY[8]= {0,-1,0,1,-1,1,1,-1};

const double PI=3.141592653589793;
//==================================================================
/* I/O */
//scan
void SCAN(int *a){scanf("%d",a);}                             //scan for type int
void SCAN(int *a,int n){REP(i,n){scanf("%d",&a[i]);}}   //scan for type int array
void SCAN(Pii *a){scanf("%d",&a->fi);scanf("%d",&a->se);}     //scan for type pair<int, int>
void SCAN(LL *a){scanf("%lld",a);}                            //scan for type long long int
void SCAN(LL *a,int n){REP(i,n){scanf("%lld",&a[i]);}}  //scan for type long long int array
void SCAN(char *c){scanf(" %c",c);}                           //scan for type char
void SCAN(char *c,int n){REP(i,n){scanf(" %c",&c[i]);}} //scan for type char array

//print 
void PRINT(int a){printf("%d\n",a);}
void PRINT(int *a,int s,char c='\n'){REP(i,s){if(i==s-1){c='\n';}printf("%d%c",a[i],c);}}
void PRINT(Vi a,char c='\n'){REP(i,a.size()){if(i==a.size()-1){c='\n';}printf("%d%c",a[i],c);}}
void PRINT(LL a){printf("%lld\n",a);}
void PRINT(LL *a,int s,char c='\n'){REP(i,s){if(i==s-1){c='\n';}printf("%lld%c",a[i],c);}}
void PRINT(double a){printf("%.15f\n",a);}
void PRINT(double *a,int s,char c='\n'){REP(i,s){if(i==s-1){c='\n';}printf("%f%c",a[i],c);}}
void PRINT(char a){printf("%c\n",a);}
void PRINT(string a){printf("%s\n",a.c_str());}
//==================================================================
int main(){
	// cin.tie(0);
	// ios::sync_with_stdio(false);
	int w,a,b;
	SCAN(&w);SCAN(&a);SCAN(&b);
	if(abs(a-b)<=w){
		PRINT(0);
	}else{
		PRINT(abs(a-b)-w);
	}

	return 0;
}