"use strict";
    
const main = arg => {
    arg = arg.trim().split("\n");
    const A = parseInt(arg[0].split(" ")[0]);
    let B = parseInt(arg[0].split(" ")[1]);
    let C = parseInt(arg[0].split(" ")[2]);
    
    let answer = C;
    
    for(let i=B; i<A; i++) {
        if(C === 0) {
            console.log(C);
            return;
        }
        
        C--;
    }
    
    console.log(C)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));
