#include <iostream>

using namespace std;

int main() {
	int M, N, konacno;
	
	cin >> N >> M;
	
	int u, s;
	
	u = (N - 2) * (M - 2);
	s = (M * N) - u;
	
	
	if(M <= 2 || N <= 2) {
		konacno = M * N;
	}
	else
	konacno = s + (u / 2);
	
	cout << konacno << endl;

	return 0;	
}