#include #include #include #include #include #include #include #include #include using namespace std; int main(int argc, char *argv[]) { long long int x_val, y_val, curr_max; cin >> x_val >> y_val; if(x_val == 1 && y_val == 1) cout << 0 << endl; else if(x_val == 1) cout << y_val -1 << endl; else if(y_val == 1) cout << x_val - 1 << endl; else cout << max(x_val, y_val)-1 + max(x_val,y_val)*(min(x_val,y_val)-1) << endl; return 0; }