#include <iostream>
#include <cmath>;
using  namespace std;
typedef long long ll;
int main()
{
	ll M, N, r;
	cin >> N >> M;
	if (N < 3 || M < 3) cout << N * M;
	else
	{ 
		ll M1 = M - 2;
		ll N1 = N - 2;
		r = M1 / 2 * ((N1 + 1) / 2) + (M1 + 1) / 2 * (N1 / 2) + M*2+2*N1;
	}
	cout << r; 
	
    return 0;
}