#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)); } cout << min(max(a,c)-b,ans) << endl; }