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

ll f(ll x, ll y){
    if(x == 1 && y == 1)
        return 1;
    if(x > y && x % 2 == 0)
        return x * y + 2 * f(y, x/2);
    if(y > x && y % 2 == 0)
        return x * y + 2 * f(y / 2, x);
    if(x > y){
        return x * y + f(y, x/2) + f(y, x / 2 + x / 2);
    }
    return x * y + f(y/2, x) + f(y - y/2, x);
}

int main() {
    ll h, w;
    cin >> h >> w;
    cout << f(h, w);
}