

#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

ll f(ll n, ll m){
    if(n <= 1 and m <= 1){
        return n * m;
    }
    if(n > m){
        return n * m + f(n/2, m) + f(n/2 + n % 2, m);
    }
    else{
        return n * m + f(n, m/2) + f(n, m/2 + m % 2);
    }
}


int main(){
    ll n, m;
    cin>>n>>m;
    cout<<f(n, m);
}