#include<bits/stdc++.h>
using namespace std;
int main(){
	#define int long long
	int n,m;
	cin>>n>>m;
	if(n==1 || m==1){
		cout<<max(m,n);
		return 0;
	}
	if(n==2 || m==2){
		cout<<2*max(m,n);
		return 0;
	}
	int rez = 0;
	rez+=2*n;
	rez+=2*(m-2);
	int b = m-2;
	int a = n-2;
	rez+=(int)ceil((double)a/2)*(int)floor((double)b/2);
	rez+=(int)floor((double)a/2)*(int)ceil((double)b/2);
	cout<<rez<<endl;
	return 0;
}