#include using namespace std; typedef long long ll; int main(){ int x, y, d; cin >> x >> y >> d; int ans = 0; for(int i = 0; i <= x; i++){ if(y >= -i+d && -i+d >= 0) ans++; } cout << ans << endl; return 0; }