#include <bits/stdc++.h>
using namespace std;
int xx(int a, int b, int c) { return (min(a, min(b, c))); }
int main() {
  int a, b, c, min, n, i, y;
  while (cin >> a >> b >> c) {
    min = 5000;
    for (i = xx(a, b, c); i <= (max(a, max(b, c))); i++) {
      n = abs(a - i) + abs(b - i) + abs(c - i);
      if (n < min) min = n;
    }
    cout << min << endl;
  }
  return 0;
}
