#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[5];
  scanf("%d %d %d", &x[0], &x[1], &x[2]);
  sort(x, x + 3);
  int ans = 0x3f3f3f3f;
  for (int i = x[0]; i <= x[2]; i++) {
    ans = min(ans, abs(i - x[0]) + abs(i - x[1]) + abs(i - x[2]));
  }
  cout << ans << endl;
  return 0;
}
