#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, ans = 0, mid = 0, res = 0;
  cin >> n >> m >> a;
  res = max(n, max(m, a));
  ans = min(n, min(m, a));
  if (res == n || ans == m && res == m || ans == n) {
    mid = a;
  }
  if (res == m || ans == a && res == a || ans == m) {
    mid = n;
  }
  if (res == a || ans == n && res == n || ans == a) {
    mid = m;
  }
  cout << abs(mid - res) + abs(mid - ans);
  return 0;
}
