X, Y, Z = [int(i) for i in input().split()] if Y <= Z: print(Z - 2) elif X <= Z <= Y: print(Z - 1) else: print(Z)