#include<iostream>

using namespace std;

int main()
{
	
	int n, m;
	cin >> n >> m;
	
	if (( n <= 2) || (m <= 2)) {
		cout << n * m;
		return 0;
	}
	
	long long int okvir = 2 * m + 2 * (n - 2);
	
	m -= 2;
	n -= 2;
	
	if (m % 2 == 0) {
		cout << okvir + (m / 2) * n << "\n";
	}
	else {
		cout << okvir + (m / 2) * ((n + 1) / 2) + ((m + 1) / 2) * (n / 2) << "\n";
	}
	
	return 0;
}