#include <fstream>
#include <cstdio>
#include <vector>
#include <string>

using namespace std;

int main()
{
	ifstream cin("nose.in");
	ofstream cout("nose.out");
	int n, m, ans = 0;
	cin >> n >> m;
	cout << (n - 1) * m + (m - 1) * n << endl;
}

