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