#include <bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef long long ll;

ll f(ll n, ll m){
    if (n == 1 and m == 1){
        return 1LL;
    } else {
        ll t = n;
        n = min(n, m);
        m = max(t, m);
        if(m % 2 == 0){
            return f(n, m / 2) * 2 + m * n;
        }else{
            return f(n, (m + 1) / 2) + f(n, m / 2) + m * n;
        }
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    ll h, w;
    cin >> h >> w;
    ll n = min(h, w), m = max(h, w);
    cout << f(n, m);
}
