function Main (input) {
  var inputs = input.split(/\s/g).map(function (num) { return parseInt(num) });
  var result = Math.min(
    Math.abs(inputs[0] - inputs[1]) + Math.abs(inputs[1] - inputs[2]),
    Math.abs(inputs[1] - inputs[2]) + Math.abs(inputs[2] - inputs[0]),
    Math.abs(inputs[2] - inputs[0]) + Math.abs(inputs[0] - inputs[1])
  )
  console.log('%s',result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
