// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define ln "\n"
#define ff first
#define ss second
using namespace std;
using namespace __gnu_pbds;

map<pair<ll, ll>, ll> cache;

ll search(ll w, ll h){
	if (w==1 and h==1) return 1;
	if (cache[{w, h}]==0){
		ll ans = 0;
		if (w>h){
			if (h>1){
				ans=search(w, h-1)+search(w, 1);
			}else{
				ans = 1+search(w-1, h);
			}
		}else{
			if (w>1){
				ans=search(w-1, h)+search(1, h);
			}else{
				ans = 1+search(w, h-1);
			}		
		}
		cache[{w, h}]=ans+w*h;
	}
	return cache[{w, h}];
}


void solve(){
	ll h, w; cin >> h >> w;
	cout << search(w, h) << ln;

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	ll t=1; 
	// cin >> t;
	while (t--) solve();
}