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