#ifdef Local
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;


template<typename T>
istream &operator>>(istream &in, vector<T> &a) {
    for (auto &i: a)in >> i;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> &a) {
    for (auto &i: a)out << i << ' ';
    return out;
}

ll rec(ll w, ll h) {
    if(w<h){
        swap(w, h);
    }
    if(h==1){
        return (w*w+3*w-2)/2;
    }
    return rec(1, h)+w*h+rec(w-1, h);
}

void solve2() {
    ld r;
    int n, m;
    cin >> n >> m >> r;
    vector<pair<ld, int>> x(n);
    for (int i = 0; i < n; ++i) {
        ld w;
        int d;
        cin >> d >> w;
        x[i] = {w, d};
    }
    x[0].first *= r;
    for (int i = 1; i < n; ++i) {
        x[i].first = x[i - 1].first * (1 - r) + r * x[i].first;
        //cout << x[i].first << ' ';
    }
    for (int i = 0; i < m; ++i) {
        int lf = -1, rg = n, mid;
        int q;
        cin >> q;
        while (rg - lf > 1) {
            mid = (lf + rg) / 2;
            if (x[mid].second <= q) lf = mid;
            else rg = mid;
        }
        if (lf > -1 and x[lf].second == q) cout << x[lf].first << ' ';
        else if (lf == -1) cout << 0 << ' ';
        else cout << x[lf].first * (1 - r) << ' ';
    }
}

void solve() {
    ll w, h;
    cin>>h>>w;
    cout<<rec(h, w)<<"\n";
}



signed main() {
#ifdef Local
    freopen("in.in","r",stdin);
    freopen("out.out","w",stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#endif
    int t = 1;
    if (t == -1)cin >> t;
    for (int i = 0; i < t; i++)solve();
}

