#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
#include<unordered_set>
#include<unordered_map>
#include<queue>
#include<stack>
#include<deque>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()
int getans(int h, int w) {
	if (h > w)
		swap(h, w);
	if (h == 1) {
		int ans = w - 1;
		ans += (w + 1)*w / 2;
		return ans;
	}
	return h*w + getans(w - 1, h) + getans(1, h);
}

void solve() {
	int h, w;
	cin >> h >> w;
	cout << getans(h, w);
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}
}