#include <iostream>

using namespace std;

int main()
{
	int n, m;
	cin >> n >> m;
	long long br = (n-1)*2 + (m-2)*2 + (((n*m) -((n-1)*2 + (m-2)*2))/2)+1;
	if(n < 3 || m < 3) br = n*m;
	
	cout << br;
}