#include <iostream>
using namespace std;

int main()
{
	long long a, b;
	unsigned long long x;
	cin >> a >> b;
	if (a == 1) x = b;
	else if (b == 1) x = a;
	else
	{
		if (a % 2 == 0)
		{
			x = 2 * a + 2 * b - 4 + ((a - 2) * (b - 2) / 2);
		}
		else
		{
			x = 2 * a + 2 * b - 4 + ((a - 3) * (b - 2) / 2)+a/2;
		}
	}

	cout << x;


}