#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	ll n, m;
	cin >> n >> m;
	if (n < m) swap(n, m);
	ll res = (n - 1) + (m - 1) * n;
	cout << res << endl;
}