x,y,d = [int(i) for i in input().split()] if d > x+y: print(0) elif d == 0: print(1) elif d > x or d > y: if x > y: print(x) else: print(y) else: if x > y: print(x+1) else: print(y+1)