#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const int MOD = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const long long int linf = 0x3f3f3f3f3f3f3f3fll;
int main() {
  ios::sync_with_stdio(false);
  int n, a, b;
  cin >> n >> a >> b;
  cout << min(n - a, b + 1) << endl;
  return 0;
}
