#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum = 0, counter = 0;
  int n = 3, min = 999999999, max = 0, minchisl, maxchisl;
  int mass[3];
  for (int i = 0; i < n; i++) {
    cin >> mass[i];
    if (mass[i] < min) {
      min = mass[i];
      minchisl = i;
    }
    if (mass[i] > max) {
      max = mass[i];
      maxchisl = i;
    }
  }
  for (int j = 0; j < n; j++) {
    if (maxchisl == j) {
      continue;
    }
    if (j == minchisl) {
      continue;
    }
    if (mass[j] > min && mass[j] < max) {
      int chisl = (mass[j] + mass[maxchisl]) / 2;
      counter = (chisl - mass[j]) + (mass[maxchisl] - chisl) + (mass[j] - min);
      cout << counter;
      return 0;
    }
  }
}
