#include <bits/stdc++.h>
using namespace std;
int main() {
  int person1, person2, person3;
  cin >> person1 >> person2 >> person3;
  int ans = INT_MAX;
  int distance = abs(person1 - person2) + abs(person1 - person3);
  ans = min(ans, distance);
  distance = abs(person2 - person1) + abs(person2 - person3);
  ans = min(ans, distance);
  distance = abs(person3 - person1) + abs(person3 - person2);
  ans = min(ans, distance);
  cout << ans << endl;
  return 0;
}
