#include <bits/stdc++.h>

int main()
{
	uint64_t N, M;
	uint64_t uk = 0, unutra = 0;
	
	std::cin >> N >> M;
	
	if(N == 1 || M == 1)
		uk = N * M;
	else
	{
		uk += N * 2;
		uk += (M - 2) * 2;
		unutra = N * M - uk;
		uk += unutra / 2;
	}
	
	std::cout << uk;
	
	return 0;
}