#include <bits/stdc++.h>
#define S second
#define F first
#define int long long
#define pb push_back
#define all(x) x.begin(),x.end()
#define yes "YES"
#define no "NO"
#define ent "\n"
#define rv reverse
#define fr(i,x,y) for(int i = x;i <= y;i++)
#define frr(i,x,y) for(int i = x;i >= y;i--)
using namespace std;


void solve() {
	int n,m;
	cin>>n>>m;
	int ans = n * m;
	int sum = n * m;
	while(ans != 1){
		sum += ans / 2 + (ans % 2 == 1);
		if(ans % 2 == 1){
			ans /= 2;
			ans++;
		}
		else {
			ans /= 2;
		}
	}
	cout<<sum * 2 - 2;
}

signed main() {
	//freopen ("bridges.in","r",stdin);
	//freopen ("bridges.out","w",stdout);
	int t = 1;
	//cin>>t;
	while(t--) {
		solve();
	}
}
