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