// Author:她的店里只卖樱花 // Problem: No.1860 Magnets // Contest: yukicoder // URL: https://yukicoder.me/problems/no/1860 // Memory Limit: 512 MB // Date: 2022-03-04 20:35:21 // Time Limit: 2000 ms /********************************************** * 她的店里只卖樱花 * ***********************************************/ #include #include #include #include #include #include #include using namespace std; #define fi first #define se second #define _for(i,b) for(int i=(0);i<(b);i++) #define rep(i,a,b) for(int i=(a);i<=(b);i++) #define per(i,b,a) for(int i=(b);i>=(a);i--) #define mst(abc,bca) memset(abc,bca,sizeof abc) #define ios_op cin.tie(0), cout.tie(0), ios::sync_with_stdio(0); typedef priority_queue, greater > PQ; typedef long long LL; typedef pair PII; typedef unsigned long long ULL; const int Inf = 0x3f3f3f3f, Null = 0x80808080; const double eps=1e-6; const double PI=acos(-1.0); const int MOD = 1e9 + 7; const int N = 100010; template void inline read(T &x) { int f = 1; x = 0; char s = getchar(); while (s < '0' || s > '9') { if (s == '-') f = -1; s = getchar(); } while (s <= '9' && s >= '0') x = x * 10 + (s ^ 48), s = getchar(); x *= f; } template void print(T x) { if (x < 0) { putchar('-'); print(x); return ; } if (x >= 10) print(x / 10); putchar((x % 10) + '0'); } int main (){ int n, m; cin >> n >> m; int a = max(n, m), b = n + m - a; if(a == 0) cout << 0 << endl; else cout << b * 2 + (a - b) * 2 - 1 << endl; return 0; }