#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <string>

#define ll long long
#define ld long double 

using namespace std;

int main() {
	int n, m; cin >> n >> m;
	vector <vector <int>> dp(n + 1, vector <int>(m + 1, 0));
	dp[1][1] = 1;
	for (int i = 2; i <= n; ++i) {
		dp[i][1] = i + 1 + dp[i - 1][1];
	}
		for (int j = 2; j <= m; ++j) {
			dp[n][j] = dp[n][j - 1] + dp[n][1] + n * j;
		}
	cout << dp[n][m];
}