#include <iostream>
#include <algorithm>
using namespace std;

long long rlaev(long long n, long long m) {
	if (n == m && n+m==2) return 0;
	return n*m+rlaev(max(n, m)-1, min(n, m))+rlaev(1, min(n, m));
}

int main() {
	long long n, m;
	cin >> n >> m;
	cout << n*m + rlaev(n, m);
}