#include <bits/stdc++.h>
#define ll long long
#define f first
#define s sceond
using namespace std;

int main()
{

     ll n,m;
     cin >> n >> m;
     ll anss=n*m;
     ll ans=min(n,m);
     ll ans1=n*m-ans;
     anss+=ans+ans1;
     ll sum=ans/2;
     ll sum1=ans1/2;
     ll shet=2;
    
     while (sum!=0 && sum1!=0) {
       anss+=sum*ans+sum1*ans1;
       sum/=2;
       sum1/=2;
       ans=(sum*ans+sum1*ans1)/2;
       ans1=ans;
     } cout << anss;
    return 0;
}