#include #include using namespace std; int main(void) { long long x, y, d; scanf("%lld%lld%lld", &x, &y, &d); long long res = d+1; res -= max(0ll, d-x); res -= max(0ll, d-y); printf("%lld\n", max(0ll, res)); return 0; }