x,y,z= map(int,input().split()) if z < x: print(z) elif x <= z < y: print(z-1) else: print(z - 2)