#include <bits/stdc++.h>

using namespace std;

vector <long long> u(100000000, -1);

long long f(long long n) {
    if (n == 1)
        return 1;
    if (u[n] == -1)
        u[n] = f(n);
    if (u[n / 2] == -1)
        u[n / 2] = f(n / 2);
    if (u[n - n / 2] == -1)
        u[n - n / 2] = f(n - n / 2);
    return n + u[n / 2] + u[n - n / 2];
}

int main()
{
    long long h, w;
    cin >> h >> w;
    cout << f(h * w) << endl;
    return 0;
}
