#include #include #include #include #include #include #include #include #include #include #include #define rep(i,N) for (ll i = 0; i < (N); i++) #define REP(i,N) for (ll i = (N)-1; i >= 0; i--) #define FOR(j,i,N) for (ll j = (N)-1; j > (i); j--) #define ST string #define vec vector #define out(s) cout << s << endl; #define Graph vector> #define vecs vector #define vecb vector using ll = long long; using lb = long double; using namespace std; const ll mod = 1000000007; const ll ze = 0; const lb pi = 3.14159265358979; ll nCk(ll N, ll K){ if(N>1){ ll kid = 1; for(ll i = N; i > N - K; i--){ kid = kid * i; } for(ll i = 1; i < K + 1; i++){ kid = kid / i; } return kid; } else{ return 0; } } ll stair_pow(ll N){// 階乗 ll sum = 1; for(ll i = 1; i <= N; i++){ sum = sum * i % mod; } return sum % mod; } ll gcd(ll P, ll Q){ return Q ? gcd(Q,P % Q):P; } ll lcm(ll P, ll Q){ return P / gcd(P,Q) * Q; } string change_big(string str){ transform(str.begin(), str.end(), str.begin(), ::toupper); return str; } string change_small(string str){ transform(str.begin(), str.end(), str.begin(), ::tolower); return str; } bool is_prime(ll x){ if(x <= 1){ return false; } for(ll i=2; i * i <= x; i++){ if(x%i==0){ return false; } } return true; } ll sum_of_num(ll num){// 各位の和 ll dig; ll sum = 0; while(num){ dig = num % 10; sum = sum + dig; num = num / 10; } return sum; } ll how_many_break(ll n, ll m){// 何回割れるか ll counter = 0; while (n % m == 0){ n = n / m; counter++; } return counter; } ll many_pow(ll N, ll M){ // NのM乗 if(M == 0)return 1; else{ ll sum = 1; for(ll i = 0; i < M; i++){ sum *= N; } return sum; } } ll one_to_i(ll i){ // 1からiまでの和 if(i < 0){ return 0; } else{ return i*(i+1)/2; } } ll how_many_yaku(ll num){ ll ans = 0; rep(i,num){ if(num % (i+1) == 0)ans++; } return ans; } ll Digit(ll num){ ll digit=0; while(num!=0){ num /= 10; digit++; } return digit; } ll binary_search(ll left, ll right, ll N){ ll count = 0; while (right - left > 1) { ll mid = left + (right - left) / 2; if (mid <= N) left = mid; else right = mid; count++; } return count; } /*-----------------------------------------------------------------------------------*/ // cout << fixed << setprecision(15) /* vector> p(N); for (int i = 0; i < N; i++) { int A, B; cin >> A >> B; p.at(i) = make_pair(A, B); } sort(p.begin(), p.end()); */ /* ll B,A; tie(A,B) = p.at(i); */ // continue // count(S.begin(),S.end(),''); //reverse(S.begin(), S.end()); /* ll N; cin >> N; vec P(N); rep(i,N)cin >> P[i]; map Q; for(ll i : P){ if(Q.count(i)){ Q.at(i)++; } else{ Q[i]++; } }*/ // S.substr(8, 8) /*-----------------------------------------------------------------------------------*/ int main(){ ll N,M; cin >> N >> M; ll m = 0; m = min(N,M); N = max(N,M); M = m; cout << min(N-1,M)*2 << endl; return 0; }