#include <iostream>
#include <cmath>
#include <map>
#include <vector>
#include <algorithm>
#include <time.h>
#include <queue>
#include <unordered_set>
#include <fstream>
#include <set>
#include <unordered_map>

using namespace std;
#define ll long long

ll binpow (ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)
			res = res * a;
		a = a * a;
		n >>= 1;
	}
	return res;
}


void fc (){
	ll a,b;
	cin>>a>>b;
	if (a<b){
		swap(a,b);
	}
	ll res1=a*(b+b*(b+1)/2-1);
	ll res2=b*(a*(a+1)/2-1);
	cout<<res1+res2;
	
}


int main (){
	
	
	int T=1;
//	cin>>T;
	while (T--)  fc();
  
  
  
}
