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

unsigned long long h, w;

unsigned long long rec(unsigned long long h, unsigned long long w) {
    if (h == 1 && w == 1)
        return 1;

    unsigned long long res = h * w;
    if (h % 2 == 0)
        res += rec(h / 2, w) * 2;
    else if (w % 2 == 0)
        res += rec(h, w / 2) * 2;
    else if (w > 1)
        res += rec(h, w / 2) + rec(h, w / 2 + 1);
    else
        res += rec(h / 2, w) + rec(h / 2 + 1, w);

    return res;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    cin >> h >> w;
    cout << rec(h, w);

    return 0;
}
