#include <bits/stdc++.h>

#define int long long
#define pii pair<long long, long long>
#define ios_boost \
    cin.tie(0);   \
    ios_base::sync_with_stdio(0)

using namespace std;

int calc(int l) {
    return l * (l + 1) / 2 + l - 1;
}

signed main() {
    ios_boost;

    int h, w, ans = 0;
    cin >> h >> w;
    while (h > 0 && w > 0) {
        ans += h * w;
        if (h < w) swap(h, w);
        ans += calc(w);
        h--;
    }
    cout << ans - 1 << "\n";
}
