#include <bits/stdc++.h>
#define forEach(vec, i) for (auto i = vec.begin(); i < vec.end(); ++i)

using namespace std;

typedef unsigned long long int ulli;
typedef long long int ll;

vector<ulli>cache(1000001, 0);

ulli carpet (int n, int m) {
    if (n == 1 && m == 1)
        return 1;
    if (n == 0 || m == 0) return 0;
    if (n < m) {
        swap(n, m);
    }
    ulli result = carpet(n - 1, m) + carpet(1, m) + m * n;
    return result;
}


int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cout.sync_with_stdio(0);
    int n, m;
    cin >> n >> m;
    cout << carpet(n, m);
    return 0;
}
