#include <iostream>

using namespace std;

int f(int a, int b) {
    if (a < b) // a > b
        swap(a, b);
    if (a == 1 && b == 1)
        return 1;

    if (b == 1)
        swap(a, b);

    //cout << a << " " << b << endl;

    return f(a, b / 2) + f(a, (b + 1) / 2) + a * b;
}

int main()
{
    int a, b;
    cin >> a >> b;

    cout << f(a, b) << endl;

    return 0;
}
