function Main(input) {
    input = input.split(" ").map(x => parseInt(x));
    var ans = 0;
    var str = "";
        if( Math.abs(input[1]-input[2])==1){
            str = "win both or lose both";
        }
        switch(str){
            case "win both or lose both" :
                {   
                    if(input[1]<input[2])
                    ans= input[1];
                    else
                    ans= input[2];
                }
                break;
            default:
                ans= Math.abs(input[1]-input[2])/2;
        }
    console.log(ans);
}

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