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