#include <iostream>

using namespace std;

int main() {
	int N, M;
	
	cin >> N >> M;
	
	int ivice = ((N - 2) * 2) + ((M - 2) * 2) + 4;
	int sredina = N * M - ivice;
	
	int br_redara = ivice + (sredina / 2);
	
	cout << br_redara;
	
	return 0;
}