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