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

using namespace std;
typedef long long ll;

int f(int n, int m){
    if(n == 1 and m == 1){
        return 1;
    }else{
        int t = n;
        n = min(n, m);
        m = max(t, m);
        return f(n, m - 1) + f(1, n) + n * m;
    }
}

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

    int h, w;
    cin >> h >> w;
    int n = min(h, w), m = max(h, w);
    cout << f(n, m);
}
