// inputに入力データ全体が入る
function Main(input) {
  input = input.split(" ");
  var n = input[0]
  var b = input[1]
  var r = input[2]
  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"));
