#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main(){ int n; int m; cin >> n >> m; long long sum = 0; long long sum2 = 0; sum+=(long long)n-1; sum+= (long long)((long long)n* (long long)(m-1)); sum2+=(long long)m-1; sum2+= (long long)((long long)m*(long long)(n-1)); if(sum < sum2) cout << sum << endl; else cout << sum2 << endl; return 0; }