#include "bits/stdc++.h" 
#define F first
#define S second
#define ALL(a) a.begin() , a.end()

#define OK  cout << "---------------------------OK-----------------------" << endl;
#define deb(x) cout << #x  << " = " << x << endl;
#define debv(x) cout << #x << " : " ; for(int i : x) cout << i << " "  ; cout << endl;

#define endl '\n'
#define ll long long
using namespace std ;
const ll N =  1e5;	
const ll INF = 1e9;
const ll mod = 1e9 + 7 ;
const double eps = 1e-9 ;
const int dx[4]  = { 0 , 0 , 1 , -1} , dy[4] = {1 , -1 , 0 , 0}  ;
using namespace std;

int main(){
	long long n, m;
	cin >> n >> m;
	long long ans = n * m;
	while(max(n,m) > 1){
		if(n < m)
			swap(n,m);
		ans += m * (m + 1) / 2 + (m - 1);
		n--;
		ans += (n) * m ;
	}
	cout << ans << endl;
}