#include <iostream>
#include <vector>

using ll = long long;
using namespace std;

int main() {
    ll h, w;
    cin >> h >> w;
    ll ans = h*w;
    while (h*w!=0){
        if (w > h) {
            ans += h + h * (h + 1) / 2 - 1;
            --w; ans += w * h;
        }
        else {
            ans += w + w * (w + 1) / 2 - 1;
            --h; ans += w * h;
        }
    }
    cout << ans-1;
    return 0;
}