function Main(input) {
  input = input.split(" ").map(Number);
  var N = input[0];
  var A = input[1];
  var B = input[2];
  if(A%2==B%2){
    console.log((A+B)/2);
  }else{
    var U =0;
    var D =0;
    console.log(Math.min(Math.max(A,B),Math.max(N-A,N-B))
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));