#include <bits/stdc++.h>
const int mod = 1e9 + 7;
int mul(int x, int y) { return 1LL * x * y % mod; }
int qpow(int x, int y) {
  int res = 1;
  while (y) {
    if (y & 1) res = mul(res, x);
    y >>= 1;
    x = mul(x, x);
  }
  return res;
}
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
using namespace std;
int x[3];
int main(int argc, char *argv[]) {
  for (int i = 0; i < 3; ++i) x[i] = read();
  int ans = 1 << 30;
  for (int i = 0; i <= 100; ++i) {
    int ret = 0;
    for (int j = 0; j < 3; ++j) ret += abs(x[j] - i);
    ans = min(ans, ret);
  }
  cout << ans << endl;
  return 0;
}
