#131 manhattann distance x,y,d=(int(i) for i in input().split()) if x>y: m=y else: m=x if m*2d: print(d+1) else: m*=2 print(m-d+1)