x,y,z=map(int,input().split());a=0 if x<=z:a+=1 if y<=z:a+=1 print(max(z-a,0))