#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<set>

using namespace std;
using ll = long long;

int main() {
	int h, w;
	cin >> h >> w;
	vector<int>v1(h+1);
	vector<int>v2(w+1);
	v1[1] = 1;
	v2[1] = 1;
	for (int j = 2; j <= h; j++) {
		v1[j] = v1[j-1] + j + 1;
	}
	v2[1] = v1[h];
	for (int i = 2; i <= w; i++) {
		v2[i] = v2[i-1] + (i*h)+v2[1];
	}
	cout << v2[w];
}