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