x,y,z = [int(i) for i in input().split()] if x <= z: z -= 1 if y <= z: z -= 1 print(z)