#include <bits/stdc++.h>
#define max(a,b) ((a>b)?(a):(b))
#define min(a,b) ((a<b)?(a):(b))
#define MEM(a,b) memset(a,b,sizeof(a))
using namespace std;
typedef long long LL;
typedef pair<int,int>pii;
const int mod = 1e9 + 7;
int main() {
    int n, m;
    cin >> n >> m;
    cout << (n - 1) * (m - 1) << endl;
}
