#include<bits/stdc++.h>
using namespace std;
int main(){
	long long a, b;
	cin >> a >> b;
	if (a < b){
		int t = a;
		a = b;
		b = t;
	}
	long long s = 2 * a * b;
	long long n = a, m = b;
	a --;
	while(a > 1){
		s += a * b;
		a --;
	}
	while(b > 1){
		s += b * n;
		b --;
	}
	if (m == 1 && n == 1) cout<<1;
	else cout << s;
}