function Main(input) {
  input = input.split(" ").map(Number).sort(function(a,b){return a-b;});
  if((input[1]-input[0])%2==0){
  console.log((input[1]-input[0])/2+input[2]-input[1]);
  }else{
    console.log((input[2]*2-input[1]-input[0]+3)/2);
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());
