# No.857 素振り x, y, z = [int(i) for i in input().split()] if z < x: print(z) elif x <= z < y: print(z - 1) else: print(z - 2)