#include <bits/stdc++.h>
#define int long long
using namespace std;
int h, w, i, dp[1000001];

int kek(int x) {
	if (x == 1) return 1;
	return x * (x + 1) / 2 + x - 1;
}
signed main() {
    cin.tie(0)->sync_with_stdio(0);
	 int h, w;
	 cin >> h >> w;
	 dp[1] = kek(w);
	 for (int i = 2; i <= h; i++) {
	 	dp[i] = dp[i - 1] + dp[1] + w * i;
	 }
	 cout << dp[h];
}
