import Foundation
 
let strs = readLine()!.componentsSeparatedByString(" ")
let a = Int(strs[0])!
let b = Int(strs[1])!
let min = min(a, b)
if min == a {
  print("\(a)")
} else {
  print("\(a - 1)")
}