#include <bits/stdc++.h> using namespace std; int main(){ int q,p; cin>>p>>q; cout<<(p-1)*(q-1)-1<<endl; return 0; }