#include <iostream> using namespace std; int main(){ int p, q; cin >> p >> q; cout << (p - 1) * (q - 1) - 1 << endl; return 0; }