#include <bits/stdc++.h>

using namespace std;

#define int unsigned long long

signed main()
{
    unsigned long long h, w;
    cin >> h >> w;
    unsigned long long sum = h * w;
    int a, c;
    while (h || w)
    {
        if (h > w) {
            h--;
            a = w;
            c = a;
            while (c > 1)
            {
                a += c;
                c--;
            }
        } else {
            w--;
            a = h;
            c = a;
            while (c > 1)
            {
                a += c;
                c--;
            }
        }
        sum += a + h * w;


    }
    cout << sum - 1;
    return 0;
}
