#include "bits/stdc++.h" using namespace std; typedef long long ll; void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;}; int main(){ ll x, y, d; cin >> x >> y >> d; if(x + y < d){ cout << 0 << endl; return 0; } cout << min(d + 1, x + y - d + 1) << endl; return 0; }