x,y,d = map(int,input().split()) if x > d and y > d: print(d+1) else: print(max(0,y+x-d+1))