#include <bits/stdc++.h>
using namespace std;
int main() {
  int b, g, n;
  cin >> b >> g >> n;
  int c = n + 1;
  if (b >= c && g >= c)
    cout << c << endl;
  else {
    int d = 0, e = 0;
    if (c > b) d = abs(n - b);
    if (c > g) e = abs(g - n);
    cout << c - d - e << endl;
  }
}
