const main = function(input){
  var tasks = input.split(" ").map(i => parseInt(i));
  var min = 100*3;
  
  for(var i =0;i<3;i++){
    var pat1 = Math.abs(tasks[i]-tasks[(i-1)%3]) + Math.abs(tasks[(i-1)%3] - tasks[(i+1)%3]);
    var pat2 = Math.abs(tasks[i]-tasks[(i+1)%3]) + Math.abs(tasks[(i+1)%3] - tasks[(i-1)%3]);
    var smaller = Math.min(pat1,pat2);
    
    if(min>smaller) min = smaller;
  }
  console.log(min);
}


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