// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll unsigned long long int
#define ld long double
#define ln "\n"
#define ff first
#define ss second
using namespace std;
using namespace __gnu_pbds;


void solve(){
	ll w, h; cin >> w >> h;
	if (w<h) swap(w, h);
	ll ans = (h)*((w+1)*w/2+w-1)+((h+1)*(h)/2)*w-w;
	cout << ans << ln;

}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	ll t=1; 
	// cin >> t;
	while (t--) solve();
}