"use strict";

const main = arg => {
    // 標準入力の不要な空白と改行を削除し、配列に格納する
    const input = arg.trim().split(" ");
    const N = parseInt(input[0], 10);
    const blue =parseInt(input[1], 10);
    const red = parseInt(input[2], 10);

    const blueString = "b".repeat(blue);
    const redString = "r".repeat(red);
    let wholeString = blueString + redString;

    
    while (wholeString.length < N) {
        wholeString = wholeString + wholeString;
    }

    //先頭N文字を取得
    const str  = wholeString.slice( 0, N );   // -> "あいうえお"

    var counter = function(str,seq){
        return str.split(seq).length - 1;
    }

    console.log(counter(str,"b")); 
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));  