#include<iostream>
using namespace std;
int finale(int n, int m)
{
	int r = 0;
	int ost = 0;
	r = 2*m + (n-2)*2;
	ost = (n-2)*(m-2);
	if(ost%2 == 1)
	{
		ost = ost - 1;
		r = r + ost/2;
		return r;
	}
	else
	{
		r = r + ost/2;
		return r;
	}
}
int main()
{
	int n, m;
	cin>>n>>m;
	int a[100][100];
	int minr = finale(n, m);
	cout<<minr<<endl;
}