x = int(input()) y = int(input()) z = int(input()) if x > z: print(z) elif x <= z == y: print(z - 1) else: print(z - 2)