#include <bits/stdc++.h>

using namespace std;

#define int long long

int sum = 0;

void rec(int s, int w, int h)
{
    if (s == 1) {
        sum += 1; return;
    }
    sum += s;
    int fw, fh, sw, sh;
    if (w > h) {
        fw = max(1ll, w/2);
        sw = ceill(w*1.0/2);
        fh = h;
        sh = h;
    } else {
        fw = w;
        sw = w;
        fh = max(1ll, h/2);
        sh = ceill(h*1.0/2);
    }
    rec(fw * fh, fw, fh);
    rec(sw * sh, sw, sh);
}

signed main() {
    int w, h;
    cin >> w >> h;
    rec(w*h, w, h);
    cout << sum;
}
