#include using namespace std; int main(){ int a, b, c; cin >> a >> c; if(a == c){ b = a; } else b = c - 1; cout << b << endl; return 0; }