#include <bits/stdc++.h>
#define in freopen ("input.txt", "r", stdin);
#define out freopen("output.txt", "w", stdout);
#define se second
#define fi first
#define ll long long int
#define ld long double
#define llu unsigned long long int
#define pb push_back
const int val = (2e5) + 5;
const int inf = (1e9) + 7;
double eps = 0.000000001;
using namespace std;
void solve()
{
    ll a, b, c, d, s = 0, cnt = 0;
    cin >> a >> b;
    c = a;
    d = b;
    s += (a * (a - 1) / 2) * b + ((a - 1) * b);
    s += (b * (b - 1) / 2) * a + ((b - 1) * a);
    cout << s + (a * b);
}
int main()
{
    ios_base::sync_with_stdio(0);
    int t = 1;
    //cin >> test;
    while(t --)
    {
        solve();
        cout << endl;
    }
}
