#include <bits/stdc++.h>

#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

#define fi first
#define se second
#define pb push_back
#define fr(i, l, r) for (int i = (l); i <= (r); ++i)
#define rf(i, l, r) for (int i = (l); i >= (r); --i)

using namespace std;
typedef long long ll;

void solve() {
    ll w, h;

    cin >> w >> h;

    ll ans = w * h;

    if(w > h)
        swap(w, h);

    //cout << ans << endl;

    ll qa = (h + 1) * h / 2;
    qa += h - 1;

    rf (i, w - 1, 1)
    {
        ans += i * h;
        ans += qa;
    }

    cout << ans + qa - h << endl;
}

int main() {
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    solve();

    return 0;
}
