#include <iostream>

using namespace std;

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

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