#include <bits/stdc++.h>
using namespace std;
int a, b, c, ans;
int main() {
  scanf("%d%d%d", &a, &b, &c);
  ans = 1000000000;
  ans = min(ans, abs(c - b) + abs(b - a));
  ans = min(ans, abs(b - c) + abs(c - a));
  ans = min(ans, abs(c - a) + abs(a - b));
  ans = min(ans, abs(a - c) + abs(c - b));
  ans = min(ans, abs(b - a) + abs(a - c));
  ans = min(ans, abs(a - b) + abs(b - c));
  printf("%d\n", ans);
}
