

#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define ll long long
#define sz(s) (int)s.size()
#define in insert
#define pii pair<int, int>
#define pb push_back
#define mp make_pair

map<ll, ll> q[1001000];

ll f(ll n, ll m){
    if(n > m) swap(n, m);
    // cout<<n<<' '<<m<<'\n';
    if(n <= 0 or m <= 0){
        return 0;
    }
    if(q[n][m] > 0){
        return q[n][m];
    }
    // return 0;
    // cout<<n/2<<' '<<n/2+n%2<<'\n';
    // cout<<m/2<<' '<<m/2+m%2<<'\n';
    // f(n/2+n%2, m);
    ll k1 = f(n/2, m);
    if(n > 1){
        k1 += f(n/2+n%2, m);
    }
    ll k2 = f(n, m/2);
    if(m > 1){
        k2 += f(n, m/2 + m % 2);
    }
    // q[n][m] = max(k1, k2) + (n * m);
    return max(k1, k2) + (n * m);
    // return 0; 
}


int main(){
    ll n, m;
    cin>>n>>m;
    q[1][1] = 1;
    cout<<f(n, m);
}