#include <bits/stdc++.h>
using namespace std;
int a[3];
int main() {
  cin >> a[0] >> a[1] >> a[2];
  sort(a, a + 3);
  int d = a[0] + (a[2] - a[0]) / 2;
  int res = min(a[1] - a[0] + a[2] - a[0],
                abs(d - a[0]) + abs(d - a[1]) + abs(d - a[2]));
  res = min(a[2] - a[1] + a[2] - a[0], res);
  res = min(res, a[1] - a[0] + a[2] - a[1]);
  cout << res;
  return 0;
}
