#include<bits/stdc++.h>

using namespace std;
using ll = long long;


ll f(ll h, ll w) {
    // cout << h << ' ' << w << '\n';
    if(h == 1) return w * (w + 1) / 2 + (w - 1); 
    if(w == 1) return h * (h + 1) / 2 + (h - 1);
    if(h >= w) return h * w + f(h - 1, w) + f(1, w);
    return h * w + f(h, w - 1) + f(h, 1); 
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    ll h, w;
    cin >> h >> w;
    cout << f(h, w);
}
