#include #include #include #include #include using namespace std; int main() { unsigned long long int n,m,ans = 0; cin >> n >> m; unsigned long long int ans0 = 0, ans1 = 0; // if(n == 1) // n++; //if(m == 1) // m++; ans0 = n-1 + ((n)*(m-1)); ans1 = m-1 + ((n-1) * (m)); unsigned long long int ct= min(((m-1)+(m*(n-1))), ((n-1)+(n*(m-1)))); cout << ct; return 0; }