#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
	ll h,w;
	cin>>h>>w;
	ll ans=0;
	if(h==1 && w==1){
		cout<<1;
		return 0;
	}
if(h%2==0){
	ans=(h+1)*h/2+h-1;
}
else{
	ans=(h+1)*(h/2)+(h/2+1)+h-1;
}
cout<<ans*w+h*w;
}
