var n = readLine()!.split(separator: " ").map{Int($0)!} if n[0] <= n[2]{ n[2] -= 1 } if n[0] <= n[2]{ n[2] -= 1 } print(n[2])