"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const N = parseInt(arg[0].split(" ")[0]);
    const A = parseInt(arg[0].split(" ")[1]);
    const B = parseInt(arg[0].split(" ")[2]);
    
    const mod = N % (A + B);
    
    let temp = [];
    
    for(let i=0; i<A; i++) {
        temp.push("b");
    }
    
    for(let i=0; i<B; i++) {
        temp.push("r");
    }

    let list = [];
    
    const floor = Math.floor(N / (A + B));
    
    for(let i=0; i<floor; i++) {
        list.push(temp.join(""));
    }
    
    for(let i=0; i<mod; i++) {
        list.push(temp[i])
    }
    
    list = list.join("").split("");

    
    console.log(list.filter(n=>n === "b").length);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));