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

int main(){
	long long a, b; cin >> a >> b;
	long long resenje = a*b - (a-2)*(b-2);
	resenje += max(0LL, (a-2)*(b-2)/2);
	resenje = max(resenje, 1LL);
	cout << resenje;
}