program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32):: a,b
    read*, a,b
    if (a <= b) then
        print'(i0)', a
    else
        print'(i0)', a-1
    end if
end program main