x, y, d = map(int, input().split()) if d > x + y: print(0) elif d <= x and d <= y: print(d+1) else: print(d - max(d-y, 0) - max(d-x, 0) + 1)