#include <bits/stdc++.h>
int maxf(int a, int b, int c);
int minf(int a, int b, int c);
int midf(int a, int b, int c);
int main() {
  int a, b, c;
  int x;
  int minroad;
  int max, min, mid;
  scanf("%d %d %d", &a, &b, &c);
  max = maxf(a, b, c);
  min = minf(a, b, c);
  mid = midf(a, b, c);
  minroad = a + b + c;
  for (int i = min; i <= max; i++) {
    if (fabs(min - i) + fabs(mid - i) + fabs(max - i) < minroad) {
      minroad = fabs(min - i) + fabs(mid - i) + fabs(max - i);
      x = i;
    }
  }
  printf("%d", minroad);
  return 0;
}
int maxf(int a, int b, int c) {
  if (a > b && a > c)
    return a;
  else if (b > a && b > c)
    return b;
  else
    return c;
}
int minf(int a, int b, int c) {
  if (a < b && a < c)
    return a;
  else if (b < a && b < c)
    return b;
  else
    return c;
}
int midf(int a, int b, int c) {
  if (a > b && a < c)
    return a;
  else if (b > a && b < c)
    return b;
  else
    return c;
}
