#include <iostream>
#include <cmath>
using namespace std;

int main(int argc, char** argv) {
	long a, b, a1, b1, rez;
	cin >> a >> b;
	a1=a-2;
	b1 = b-2;
	rez = (a+b)*2-4;
	rez+=a1*(b1/2) + a1/2*(b1%2);
	cout << rez << endl;
	return 0;
}