//#pragma GCC optimize("0fast")
//#pragma GCC optimize("popcnt, bm2")

#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
using ll = long long;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
    ll h, w;
    cin >> h >> w;
    ll height = h;
    ll rest = h;
    for (ll i = 1; i < h; ++i) {
        rest -= 1;
        height += rest + 1;
    }
    ll ans = w * h;
    rest = w;
    for (ll i = 1; i < w; ++i) {
        rest -= 1;
        ans += (h * rest) + height;
    }
    ans += height - h;
    cout << ans;

    return 0;
}
