#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;
    if (h == w && h == 1) {
        std::cout << 1;
        return;
    }
    ll ans1 = h * w, ans2 = h * w, cnt1 = (w * (w + 1)) / 2 - 1, cnt2 = (h * (h + 1)) / 2 - 1;
    ans1 += h * cnt1;
    ans2 += w * cnt2;
    bool flag1 = true, flag2 = true;
    if (h == 1) flag1 = false;
    if (w == 1) flag2 = false;
    for (ll i = 1; i < 25; i++) {
        ll kv = (1 << i);
        if (h == kv) flag1 = false;
        if (w == kv) flag2 = false;
        ans1 += kv * w * (ll)(h / kv);
        ans2 += kv * h * (ll)(w / kv);
    }
    ll ans3 = 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 << ans3 + kv;
            return;
        }
        ans3 += sum * kv;
    }
    std::cout << std::max({ans1 + flag1, ans2 + flag2, ans3 + h * w});
}

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