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