#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <deque>

#ifndef Debug
#pragma GCC optimize("O3")
#endif

using ll = long long;

void bipkos() {
    ll h, w;
    std::cin >> h >> w;
    ll ans = h * w;
    for (ll i = 1; i < 25; i++) {
        ll kv = (1 << i);
        ll st1 = (1 << i), st2 = 1;
        ll sum = 0;
        while (st1 > 0) {
            sum = std::max((h / st1) * (w / st2), sum);
            st1 /= 2, st2 *= 2;
        }
        if (kv == h * w) {
            std::cout << ans + kv;
            return;
        }
        ans += sum * kv;
    }
    std::cout << ans + h * w;
}

int main() {
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false);
    int t = 1;
//    std::cin >> t;
    while (t--) {
        bipkos();
    }
}
