#include <iostream>
using namespace std;
int main()
{
int x, y, z;
cin>>x>>y;
if (x<=y)
z=x+y;
}
else
z=1-x+y;
cout<<z;
#include <iostream>
using namespace std;
int main()
{
int x, y, z;
cin>>x>>y;
if (x<=y)
{
z=x+y;
}
else
{
z=1-x+y;
}
cout<<z;
}