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