#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>

using namespace std;

long long co(long long h, long long w) {
    if (h == 1 && w == 1) {
        return 1;
    }
    return h * w + co(min(h, w), (max(h, w) - 1)) + co(1, min(h, w));
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long h, w;
    cin >> h >> w;
    cout << co(h, w);
}