#include <bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef long long ll;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll h, w;
    cin >> h >> w;
    ll n = min(h, w), m = max(h, w);
    int t = m;
    for (int i = 0; i <= m - 2; i++) {
        t += m - i;
    }
    if (n > 1) {
        cout << n * t + n * m;
    }
    else {
        cout << t;
    }
}
