#include <bits/stdc++.h>
#define ll long long
#define nl '\n'


using namespace std;

ll h, w, mn, mx, sum;

int main () {
    cin >> h >> w;
    mn = min(h, w);
    mx = max(h, w);
    if (mn < 2) {
        sum += h*w;
        for (int i = 2; i <= mx; i++) {
            sum+=i;
        }
        cout << sum;
        return 0;
    }
    sum = h*w;
    sum += mx * mn;
    while (mx > 1) {
        if (mx == 2) {
            sum += mx*mn;
            break;
        }
        else {
            sum += mx * mn;
            mx--;
        }
    } cout << sum;
    return 0;
}