#include #include #include #include #include using namespace std; int main() { long long int row, col; cin >> row >> col; long long int ans = 0; if (row ==1 && col ==1) ans = 0; else{ ans = (row) * (col-1) + (row-1); } cout << ans << endl; return 0; }