x, y, d = map(int, input().split()) ans = min(d, x) - max(d - y, 0) + 1 print(max(ans, 0))