// inputに入力データ全体が入る
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 m = b + r;
  var result = 0;
  if(n > m && b != 0) {
    result = b + n - m;
  } else {
    result = b;
  }
  console.log(result)
}

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