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