#include using namespace std; int main(){ int a,b,c;cin>>a>>b>>c; int ans = abs(a-c); if(b > a && b > c){ ans = min(ans,b-max(a,c)); } if(0 < max(a,c)-b)ans = min(ans,max(a,c)-b); cout << ans << endl; }