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

int main()
{
	int n, m;

	std::cin >> n >> m;

	if (n == 1 || m == 1)
	{
		cout << m * n;
		return 0;
	}	

	int br = (n + m) * 2 - 4;

	n -= 2;
	m -= 2;

	if (n == 0 || m == 0)
	{
		cout << br;
		return 0;
	}

	br += (m / 2) * ((n + 1) / 2) + ((m + 1) / 2) * (n / 2);

	cout << br;
	
 	return 0;
}