#include <bits/stdc++.h>

using namespace std;

using ll = long long;

ll F(ll h, ll w, vector <ll> &v)
{
    if(h < w)
    {
        swap(h, w);
    }
    if(w == 1)
    {
        return v[h];
    }
    return h * w + v[w] + F(h - 1, w, v);
}

void solve()
{
    ll h, w;
    cin >> h >> w;
    ll n = max(h, w);
    vector <ll> v(n + 1);
    v[1] = 1;
    for(ll i = 2; i <= n; i++)
    {
        v[i] = i + 1 + v[i - 1];
    }
    cout << F(h, w, v);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    ll t = 1;
    //cin >> t;
    for(ll i = 0; i < t; i++)
    {
        solve();
    }
    return 0;
}
