# include <iostream>
using namespace std;
int main ()
{
int n,m;
cin>>n>>m;
if(n>m)swap(n,m);
if(m<2*n)cout<<2*n-2<<endl;
else cout<<2*n<<endl;
return 0;
}