#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define all(x) x.begin(), x.end()
#define dbg(x) cout << (x) << "\n"
string s;

int main(){
	ll n, m, br;
	cin >> n >> m;
	
	if(n == 1 or n == 2 or m == 1 or m == 2){
		dbg(n*m);
	} else{
		if(n == 3 and m == 3)
			dbg(8);
		else{
			if(m % 2 == 0){
				br = n * m - ((m-2)/2) * (n-2);
				dbg(br);
			} else{
				if(n % 2 == 0){
					br = n * m - ((n-2)*(m-2)/2);
					dbg(br);
				}
				else{
					br = n * m - ((n-2)*(m-2)/2) - 1;
					dbg(br);
				}
			}
		}
	}

	return 0;
}