#include <bits/stdc++.h>

using namespace std;
using ll = long long;

map<pair<ll, ll>, ll> dp;


ll f(ll a, ll b) {
    if (a > b)
        swap(a, b);
    auto it = dp.find({a, b});
    if (it != dp.end()) {
        return it->second;
    }

    return dp[{a, b}] = f(a, b - 1) + f(a, 1) + a * b;
}


signed main() {
    std::ios::sync_with_stdio(false), std::cin.tie(nullptr), std::cout.tie(nullptr);

    dp[{1, 1}] = 1;

    ll h, w;
    cin >> h >> w;

    cout << f(h, w);

}