#include <bits/stdc++.h>
using namespace std;
void sprint(string s) {
  for (int i = 0; i < s.size(); ++i) printf("%c", s[i]);
  printf("\n");
}
int main() {
  int ans = 10000;
  int x[3];
  for (int i = 0; i < 3; ++i) {
    cin >> x[i];
  }
  sort(x, x + 3);
  for (int i = x[0]; i < x[2] + 1; ++i) {
    ans = min(ans, abs(i - x[0]) + abs(i - x[1]) + abs(i - x[2]));
  }
  cout << ans << endl;
  return 0;
}
