#include <bits/stdc++.h>
using namespace std;
long double calc1(double n){
	return ((n*n)/2+n*0.5+n-1);
}
long long calc2(double n, double m){
	if(m==0) return 0;
	else return (n*((m*m)/2+m*0.5))-n;
}
int main(){
	double n,m;
	cin >> n >> m;
	if(m>n) swap(n,m);
	cout << calc1(n)*m+calc2(n,m);
}
