#include <iostream>

using namespace std;

int main(){
	int n, m;
	cin >> n >> m;
	if ((n<3) or (m<3)) cout << m*n;
	else if ((n*m) % 2 == 1) cout << (n*m - (n-2)*(m-2)/2 - 1);
	else cout << (n*m - (n-2)*(m-2)/2);
}