#include #include #include using namespace std; using ll = long long; int main() { int a, b, c; cin >> a >> b >> c; int m = min(min(abs(a - b), abs(a - c)), abs(b - c)); if ((a > b > c) || (a < b < c)) cout << "0" << endl; else cout << m << endl; return 0; }