#include <bits/stdc++.h>
using namespace std;
/*
<<<<It's never too late for a new beginning in your life>>>>
Today is hard
  tomorrow will worse
  but the day after tomorrow will be the sunshine..

HARD WORK BEATS TALENT WHEN TALENT DOESN'T WORK HARD............
Never give up  */

//The most CHALISHKANCHIK
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl '\n'
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define rew(i, a, b) for(int i = a; i < b; i++)
#define wer(i, a, b) for(int i = b - 1; i >= a; i--)
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;

void solve(){
	int x,y,x1=1,cx=1,sx,sumx=0;
	int y1=1,cy=1,sy,sumy=0;
	cin>>x>>y;
	//sumx=x;
	sx=x;
	sy=y;
	while(x1){
		if(sx==1){
			break;
		}
		if(sx%2==1){
			
			sumx+=((sx+1)/2)*y;
			cx*=2;
			sumx+=y;
			sx/=2;
			sumx+=cx*sx*y;
			//cout<<y;
		}
		else{
			cx*=2;
			sx/=2;
			sumx+=cx*sx*y;
		}
	//sumx+=(cx*sx);
		
	}
	while(y1){
		if(sy==1){
			break;
		}
		if(sy%2==1){
			sumy+=((sy+1)/2)*x;
			cy*=2;
			sumy+=x;
			sy/=2;
			sumy+=cy*sy*x;
		}
		else{
			cy*=2;
			sy/=2;
			sumy+=cy*sy*x;
			
		}
		
		
	}
	cout<<sumx+sumy+(x*y);
}
main(){
	//~ ios
	int t = 1;
	//~ cin >> t;
	while(t--){
		solve();
	}
}










