#include <bits/stdc++.h>
using namespace std;
void Solve() {
  int a, b, n;
  cin >> n >> a >> b;
  cout << n - a - max(0, n - a - 1 - b) << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    Solve();
  }
  return 0;
}
