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