#include <bits/stdc++.h>

#define mp make_pair
#define ull unsigned long long
#define ll long long
#define forn(i, n) for(int i = 0; i < n; i++)
using namespace std;

ll palochka(ll b) {
    ll ans = 0;
    ans += b;
    ans += ((b + 2) * (b - 1) / 2);
    return ans;
}

ll rec2(ull h, ull w) {
    ull a = max(h, w), b = min(h, w);
    ull ans = 0;
    while(true) {
        if (a == 1) break;
        ans += a * b;
        a--;
    }
    ans += max(h, w) * palochka(b);
    return ans;
}

void start() {
    ll h, w; 
    cin >> h >> w;
    cout << rec2(h, w) << "\n";
}

int main() {
    int t = 1;
    //cin >> t;
    while(t--)
        start();
}