x, y, d = [ int(v) for v in input().split(" ") ] c = x + y - d + 1 if x >= d and y >= d: print(d+1) elif x >= d: print(y+1) elif y >= d: print(x+1) elif c < 0: print(0) else: print(c)