#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ull = unsigned long long;

void solve() {
    int n, m;
    cin >> n >> m;
    ll s = n * m, f = 1, res = 0;
    while (s > 1) {
        if (s % 2 == 0) {
            f++;
            s = s / 2;
        } else {
            s = s / 2;
            res += f;
        }
    }
    cout << f * (n * m) + res;
}

signed main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#endif
    int t = 1;
//    cin >> t;
    while (t--) solve();
}

