#include <iostream>

using namespace std;

long long solve() {
	long long n, m;
	cin >> n >> m;
	if (m == 1) return n;
	if (n == 1) return m;
	long long s = n * 2 + (m - 2) * 2;
	if (m == 2 || n == 2) return s;
	n -= 2;
	m -= 2;
	long long p = (n + 1) / 2 * (m / 2);
	long long q = n / 2 * ((m + 1) / 2);
	return s + p + q;
}

int main() {
	cout << solve();
}