#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>

#define ssort(arr) sort(arr.begin(), arr.end())

using namespace std;


using ll = long long;

const ll INF = 1e9;


map<ll, ll> chache;


ll f(ll n){
    ll cnt = n;

    if(chache[n] != 0){
        return chache[n];
    }

    cnt += f(n / 2);
    cnt += f(n - (n / 2));

    chache[n] = cnt;
    return cnt;
}


int main()
{
    chache[1] = 1;
    ll n, m, N;
    cin >> n >> m;
    N = n * m;


    cout << f(N);


    return 0;
}
