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

using namespace std;
typedef long long ll;

ll f(int n, int m){
    if (n == 1 && m == 1){
        return 1ll;
    } else {
        int t = n;
        n = min(n, m);
        m = max(t, m);
        if (m % 2) {
            return f(n, m - 1) + f(1, n) + n * m;
        }
        else {
            return f(n, m / 2) * 2  + n * m;
        }
    }
}

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

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