#include using namespace std; using ll = long long int; using P = pair; using vi = vector; using vl = vector; using vll = vector; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i <= (int)(n); i++) const ll INF = 1LL << 60; const double pi = acos(-1); ll mod = 1000000007; ll x[200005],y[200005],z[200005],w[200005]; int main() { ll x,y,d; cin >> x >> y >> d; ll i,j,cnt = 0; if(x + y >= d) { for(i = d;i >= 0;--i){ j = d - i; if(i <= x && j <= y) cnt++; else continue; } } cout << cnt << endl; return 0; }