#include #include #include using namespace std; long long x,y,d; int main(void){ cin >> x >> y >> d; if(x > y) swap(x,y); if(d <=x) cout << d+1 << endl; else if(x < d && d <= y) cout << x+1 << endl; else cout << max(0LL,x+y-d+1) << endl; }