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