function Main(input) {
    input = input.split(" ");
    var n = parseInt(input[0], 10);
    var b = parseInt(input[1], 10);
    var r = parseInt(input[2], 10);
    var s = `${"b" * b}${"r" * r}` * 10 ^ 100;
    s.slice(0, n);
    var targetStr = "b";
    var a = (s.match(new RegExp(targetStr, "g")) || []).length;
    console.log(a)
}

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