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

using namespace std;
using ll = long long;

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