#include <iostream>

using namespace std;

int main() {
	long long X, Y;
	cin>>Y>>X;
	long long total = 0;

	if(X == 1) 		total += Y;
	else if(Y == 1) total += X;
	else if(Y == 2) total += 2 * X;
	else if(X == 2) total += 2 * Y;
	else            total += 2 * X  +  2 * (Y - 2)  +  (Y - 2) * (X - 2) / 2;
	
	cout<<total;
	return 0;
}