#include <iostream>

using namespace std;

int main() {
	long long int a, b, c, x;
	cin >> a >> b;
	if(a < 3 || b < 3) {
		cout << a*b << endl;
	}else{
		c = ((a - 2)*(b - 2)) / 2;
		x = (a*b) - ((a - 2)*(b - 2) - c);
		cout << x << endl;
	}
	
	return 0;
}