#include <bits/stdc++.h>
using namespace std;
	typedef long long ll;
	typedef vector<ll> vct;
ll s = 0;
void f(ll h, ll w) {
	s+= h * w;
	if (h == 1 and w == 1){
		return;
	}
	ll mx = max(h, w) - 1;
	ll mn = min(h, w);
	f(mn, mx);
	f(mn, 1);
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	ll h, w;	
	cin >> h >> w;
	f(h, w);
	cout << s;
	return 0;
}
