#include <bits/stdc++.h>
using namespace std;
int main () {
	long long n, m;
	cin >> n >> m;
	
	
	double long d1 = n / 1.0;
	double long d2 = m / 1.0;
	double long D = ceil((d1 + d2) / 2);
	long long s = n * m;
	if (n == m or (n % 2 != 0 and m % 2 != 0)) 
		cout << s * (min(n, m) + 1);
	else if ((n % 2 != 0 and  m % 2 == 0) or (n % 2 == 0 and m % 2 != 0) )
	 { if (min(n, m) != 1) {
	    cout << s * (min(n, m) + 1) + min(n, m) * 2;
	} else {
		cout << s * D;
	}
}
}
		
		
		
// 	else if ((n % 2 != 0 and  m % 2 == 0 or 
// 			(n % 2 == 0 and  m % 2 != 0)) and (n != 1 or m != 1))
// 		cout << s * (min(n, m) + 1) + min(n, m) * 2;
// 		else    
// 		    cout << max(n, m) * max(n,m);

