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