x, y, z = map(int, input().split()) if z >= x or z >= y or z > 0: z -= 1 print(z)