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