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

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

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