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