#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;


ll calc(ll h, ll w, ll cnt) {
    ll now = h * w * cnt;
    if (h * w == 1) {
        return now;
    }
    if (h < w) {
        swap(h, w);
    }
    if (h %2 == 0 && w % 2 == 0) {
        return now + max(calc(h / 2, w, cnt * 2), calc(h, w / 2, cnt * 2));
    }
     else if (h % 2 == 0) {
        return now + calc(h / 2, w, cnt * 2);
    } else if (w % 2 == 0) {
        return now + calc(h, w / 2, cnt * 2);
    } else {
        return calc(h / 2, w, cnt) + calc(h / 2 + 1, w, cnt) + now;
    }
}

void solve() {
    ll h, w;
    cin >> h >> w;
    cout << calc(h, w, 1) << endl;
}


signed main()
{
    int t = 1;
    //cin >> t;
    //freopen("input.in", "r", stdin);
    while (t--) {
        solve();
    }
    return 0;
}

