#include using namespace std; using pii = pair; using ll = long long; #define rep(i, j, n) for(int i = j; i < (int)(n); i++) const ll MOD = 1000000007; const ll INFL = (1LL << 60); const int INFI = (1 << 30); int main() { int A, B, C; cin >> A >> B >> C; cout << min(abs(B - A), abs(B - C)) << endl; }