//#pragma GCC optimaze("O3")
//#pragma GCC optimaze("Ofast")
//#pragma GCC optimaze("unroll-loops")
//#pragma GCC target("avx2,bmi,bmi2,popcnt,lzcnt")

#include <bits/stdc++.h>

//#define int int64_t
#define ll long long

const int MOD = 1e9 + 7;

using namespace std;
int ans=0;
void f(int h,int w,int k=1){
    if(h<w){
        swap(h,w);
    }
    ans+=h*w*k;
    if(h>1){
        if(!(h%2)){
            f(h/2,w,k*2);
        }else if(!(w%2)) {
            f(h,w/2,k*2);
        }else{
            f(h/2,w,k);
            f(h/2+1,w,k);
        }
    }
}
void solve(){
    int h,w;
    cin>>h>>w;
    f(h,w);
    cout<<ans;
}

int main() {
    int t=1;
    //cin >> t;
    for(int i = 0; i < t; ++i){
        solve();
    }
    return 0;
}
