#include using namespace std; int main() { long long n, m; cin >> m >> n; if (m > n) swap(m, n); cout << (m - 1) + m * (n - 1) << endl; }