#pragma GCC optimize("Ofast,unroll-loops,fast-math,O3")
////////////////////////////////////////////////////////IOI
                 //////////YERMEKOV///
////////////////////////////////////////////////////////TUZELKHAN
#include "bits/stdc++.h"


#define OPEN  freopen ("ancestor","r" , stdin), freopen ("ancestor","w",stdout);
#define Da ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define p_b push_back
#define max1(a,b,c) max(a,max(b,c))
#define min1(a,b,c) min(a,min(b,c))
#define all(a) a.begin() , a.end() 
#define aza cout<<" ? "<<endl;//>>>>
#define F first
#define S second
#define co continue
#define endl '\n'    
#define pre precision
using namespace std;
const long long N=1e7+9,MOD=1e9+7;
main(){
  Da
    long long h,w,ans,ans1;
    cin>>h>>w;
    ans=h*w;
    ans1=h*w;
    long long q=2,q1=2;
    while(ans1>1){
      if(ans1%2==0){
        q1=q;
        ans1/=2;
        ans+=ans1*q;
        q=q*2;
      }
      
      else{
        ans1-=1;
        ans+=min(h,w);
        ans+=ans1*q1;
      }
    }
    cout<<ans<<endl;//>>>>
}