#include <iostream>
#include <cmath>
using namespace std;
int main() {
	unsigned long long  int  x, y;
	cin >> x >> y;
	if (x == 1 && y == 1) {
		cout << 1 << endl;
	}
	else {
		long double x1, x2, y1, y2;
		x1 = floor((double)(x - 2) / 2);
		x2 = round((double)(x - 2) / 2);
		y1 = floor((double)(y - 2) / 2);
		y2 = round((double)(y - 2) / 2);
		cout << (2 * x + 2 * (y - 2)) + (x1 * y2) + (x2 * y1);
	}
}