#include <iostream>
using namespace std;

int main()
{
	long long N, M, obim;
	bool jeste = true, poseban = false;
	
	cin>>N>>M;
	obim = 2*(N+M-2);
	
	if(N%2!=0)
	{
		jeste = false;
	}
		
	if(M%2!=0)
	{
		jeste = false;
	}
		
	if(N%2!=0 && M%2!=0)
	{
		poseban = true;
	}
	
	if(obim <= 6)
	{
		cout<<M*N;
	}else
	{
		if(jeste)
		{
			cout<<((N-2)*(M-2))/2;
		}else
		{
			if(poseban)
			{
				cout<< N*M - ((N-1)*(M-1))/4 - ((N-3)*(M-3))/4;
			}else
			{
				cout<<N*M-((N-2)*(M-2))/2;
			}
		}
	}
	
	return 0;
}