#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>

using namespace std;


#define ll long long
#define str string
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define optimizator ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz size

void solve(){

}
int main(){
	ll h, w;
	cin >> h >> w;
	if(w > h) swap(h, w);
	if(w == 1){
		cout <<  1ll * (h * (h + 1ll) / 2ll - 1ll + h);
		return 0;
	}
	cout << 1ll *  w * (h * (h + 1) / 2ll) + 1ll * h * (w * (w + 1ll) / 2ll - 1ll + w) - w;
}
/*
/effect @s always_green 999999 255 true
/give @s correct_code 512
/give @s hugs 64
*/

