#include <iostream>
int main(){
	std::ios::sync_with_stdio(false);
	long n, m, s;
	std::cin >> n >> m;
	int b = n<m?n:m;
	n=n>m?n:m;
	m=b;
	if(m==1) s = n;
	else s = 2*n+2*(m-2) + (m-2)/2 * (n-2) + (m&1)*(n-2)/2;
	std::cout << s << "\n";
}