#include <bits/stdc++.h>
#define ll unsigned long long int
using namespace std;

map<pair<ll, ll>, ll> memo;

ll f(ll n) {
    return n * (n + 3) / 2 - 1;
}
ll search(ll w, ll h){
	if (w == 1 && h == 1) return 1;
	if(w < h)
	    swap(w, h);
	if (!memo.count({w, h})){
		ll ans = 0;
		if (w>h){
			if (h>1){
				ans = search(w, h - 1) + f(w);
			}else{
				ans = 1 + search(w - 1, h);
			}
		}else{
			if (w > 1){
				ans = search(w - 1, h) + f(h);
			}else{
				ans = 1 + search(w, h-1);
			}		
		}
		memo[{w, h}] = ans+w*h;
	}
	return memo[{w, h}];
}
int main(){
	ll h, w; cin >> h >> w;
	cout << search(w, h);
}