import std.stdio;                                                                                      
                                                                                                       void main() {                                                                                              int a, b;                                                                                          
    readf("%d %d\n", &a, &b);                                                                                  
    write(a - 1 + (b >= a ? 1 : 0));                                                                   
}
