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