//#include <bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <random>
#include <chrono>
/*
Bismillah hir rahman nir raheem
*/
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
#define all(v) v.begin(), v.end()
void gen(ll &s, ll n, ll m, vector<ll>& d)
{
    s += 1LL * n * m;
    if ( n <= 1 || m <= 1)
    {
        s -= n* m - 0LL;
        s += d[n * m] + 0LL;
        return;
    }
    else
    {
        ll t = n / 2;
        gen(s, m, t, d);
        gen(s, m, n - t, d);
    }
}
void solve()
{
    ll n, m;
    cin >> n >> m;
    ll ans = 0;
    vector<ll> d(n * m + 2, 0);
    d[0] = 0;
    d[1] = 1;
    for ( ll i = 2; i < n * m  + 2; i++ )
    {
        d[i] += d[i/2];
        d[i] += d[i - (i/ 2)];
        d[i] += i;
    }
    gen(ans, n, m, d);
    cout << ans;
}
 
 
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1; 
    while (t--)
    {
        solve();
        cout << endl;
    }
    return 0;
}