#include <bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define endl "\n"
#define ll long long
#define int ll
void fopn(string name){
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
const ll N=2e5+5,INF=1e18,mod=1e9+7;
int ans=0,res=0;
void F(int h, int w){
    res+=h*w;
    if(h==1 && w==1)
        return;
    if(h<w) swap(h,w);
    F(h/2,w);
    F((h+1)/2,w);
}
void f(int h, int w){
	ans+=h*w;
	if(h==1) return;
	f(h/2,w);
	f((h+1)/2,w);
}
void solve(){
	 res=ans=0;
	 int n,m;cin>>n>>m;
	 f(n,m);
	 f(m,n);
	 cout<<ans<<endl;
}
main(){
	//ios;
	int T=1;
	//cin>>T;
	for(int i=1;i<=T;i++){
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}

