#include <bits/stdc++.h>
using namespace std;

#define speed ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

int main(){
	speed;
	int n,m,sum=0,cnt=1;
	cin>>n>>m; long long b=n*m;
	if(n%2==1 or m%2==1){
	while(b!=1){	
//	cout<<sum<<" "<<cnt<<" "<<n<<endl;
		sum=sum+(b*cnt);
		b=(b+1)/2;
		cnt++;
	}
	cout<<sum+(1*cnt);
	return 0;
	}
	else{
	while(b!=1){	
//	cout<<sum<<" "<<cnt<<" "<<n<<endl;
		b=b/2;
		cnt++;
	}
	cout<<(n*m)*cnt;
	return 0;
	}
}
