//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>
using namespace std;

    typedef long long ll;
    typedef long double ld;

#define int long long

void solve() {
    ll h, w;
    cin >> h >> w;
    if (h < w) swap(h, w);
    ll ans = h * (w - 1);
    ll one = h * (h + 1) / 2 - 1;
    //cout << one << '\n';
    for (int i = 0; i < w; i++) {
        ans += h * (i + 1) + one;
    }
    cout << ans << '\n';
}

signed main() {
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);

    int t = 1;
    //cin >> t;

    while (t--) {
        solve();
    }
}
