#include <bits/stdc++.h>
using namespace std;
unsigned long long solve(int n, int m){
	if(n==1&&m==1){
		return 1;
	}
	unsigned long long sum=0;
	if(n<m){
		int tmp=m;
		m=n;
		n=tmp;
	}
	if(n%2==0){
		sum+=solve(n/2, m)*2+n*m;
	}else{
		if(m%2==0){
			sum+=solve(n, m/2)*2+n*m;
		}else{
			sum+=solve(n-1, m)+solve(1, m)+n*m;
		}
	}
	return sum;
}
int main(){
	int n, m;
	cin >> n >> m;
	cout << solve(n, m);
	return 0;
}
