#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, n;
  cin >> n >> a >> b;
  if (a >= n)
    cout << 0;
  else if (a + 1 > n - b - 1) {
    cout << n - a;
  } else
    cout << b + 1;
}
