#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int z = 2*(m+n-2);
    int brr = m-2;
    int brk = n-2;
    if(brk%2==0 || brr%2==0)
    {
    	z += (brr*brk)/2;
	}
	else
	{
		z += (brr*brk-1)/2;
	}
	cout << z;
}