function main(arg) {
    var temp = arg.split(" ").map(n=>parseInt(n));
    var A = temp[0];
    var B = temp[1];
    var C = temp[2];
    var poison = 0;
    var delicious = 0;
    
    for( var i=0; i<C; i++ ) {
        delicious++;
        poison++;
        
        if(B > 0) {
           B--;
           poison--;
           delicious++;
        } else if(A > 0) {
            A--;
            poison--;
        }
        
        if(poison > 1) { 
            delicious--;
            break;
        }
    }
    
    console.log(delicious + B);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));