#include #include #include #include #include using namespace std; int main() { long long n,m,tot; cin >> n >> m; long long mx,mn; mx = max(n,m); mn = min(n,m); tot = mx - 1; tot += mx * (mn-1); cout << tot << endl; return 0; }