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