function Main(input) {
	var str = input;
  	var ans = 0;
	var ans1 = 0;
	var ans2 = 0;
    var ans3 = 0;
    var ans4 = 0;
	var str = str.split("\n")[0];
	var num = str.split(" ");
	var n = Number(num[0]);	
	var a = Number(num[1]);	
	var b = Number(num[2]);
	
	var sa = a-1;
	var sb = b-1;
	var bn = n - b;
	var an = n - a;
	var ab = b - a;

		if (ab%2 !==0){//奇数ずれてる
			ans1 = sa+(ab+1)/2;
			ans2 = bn+(ab+1)/2;
          	if(ans1<=ans2){
            	ans = ans1;
            }else{
            	ans = ans2;
            }
		}else{
			ans = ab/2;
		}
	console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));