#include<iostream>



int main() {
	long long N, M;
	std::cin >> N >> M;
	if (N == 1) {
		std::cout << M << std::endl;
		return 0;
	}
	if (M == 1) {
		std::cout << N << std::endl;
		return 0;
	}
	long long resenje = 2 * N + 2 * M - 4;
	N -= 2;
	M -= 2;
	if (M % 2 == 0)
		resenje += (M / 2) * N;
	else if (N % 2 == 0)
		resenje += (N / 2) * M;
	else {
		resenje += (N / 2) * (M / 2 + 1);
		resenje += (N / 2 + 1) * (M / 2);
	}
	std::cout << resenje << std::endl;
	return 0;
}