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