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

typedef long long ll;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define data daaata
void boost(){
  ios_base::sync_with_stdio(NULL);
    cin.tie(NULL);
    cout.tie(NULL);
}
int T = 1;
ll h, w;

ll ans(ll h, ll w){
    if(w > h) swap(h, w);
    if(w == 1 and h == 1) return 1;
    if(h % 2 == 0) return h * w + 2 * ans(h/2, w);
    else if(w % 2 == 0) return h * w + 2 * ans(h, w/2);
    else{
        return h * w + ans(h/2, w) + ans(h/2 + 1, w);
    }
}

void solve(){
    cin >> h >> w;
    cout << ans(h, w);
}

int main(){
  boost();
    //cin >> T;
    while(T--){
        solve();
    }


  return 0;
}