#include <iostream>

using namespace std;

int main()
{
    int a,b;
    while(cin>>a>>b)
    {
        if(a>b)
            cout<<a-1<<endl;
        else
            cout<<a<<endl;
    }
    //cout << "Hello world!" << endl;
    return 0;
}
