#pragma GCC optimize("Ofast", "unroll-loops") // #define TEST #define _USE_MATH_DEFINES #include using namespace std; #define ll long long int main(void){ int A, B; cin >> A >> B; int res = 0; int tmp = 2; while (tmp--){ if (B <= A - 1) res = max(res, B * 2); else res = max(res, 2 * (A - 1) + 1); swap(A, B); } cout << res << endl; return 0; }