#include <iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<fstream>
#include<string>
#include<random>
#include<cmath>
#include<ctime>
#include<set>
#include<map>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
struct CMP
{

};
void solve();
int main()
{
	cin.tie(0)->sync_with_stdio(0);
	solve();
	return 0;
}

void solve()
{
	ll h, w;
	cin >> h >> w;
	ll curi = h, curj = w;
	ll ans = 0;
	map<pll,ll > curpr;
	curpr[make_pair(h, w)] = 1;
	while (!curpr.empty())
	{
		auto y = *(--curpr.end());
		curpr.erase(--curpr.end());
		pll k = y.first;
		ll kol = y.second;
		ans += k.first * k.second * kol;
		vector<ll>C;
		ll m = max(k.first, k.second);
		ll mn = min(k.first, k.second);
		if (m == 1)continue;
		if (m % 2 == 0)
		{
			C = { kol * 2,m / 2,mn };
			curpr[make_pair(m / 2, mn)] = curpr[make_pair(m / 2, mn)] + C[0];
		}
		else
		{
			C = { kol,m / 2 + 1,mn };
			curpr[make_pair(m / 2+1, mn)] = curpr[make_pair(m / 2+1, mn)] + C[0];
			C = { kol,m / 2,mn };
			curpr[make_pair(m / 2, mn)] = curpr[make_pair(m / 2, mn)] + C[0];
		}
	}
	cout << ans << '\n';
}