#include <iostream>
#include <cmath>
using namespace std;
int main(){
	long long unsigned n,m,k;
	cin>>n>>m;
	if(m==1 && n==1) cout<<"1";
	else{
		k=2*n+2*(m-2);
		n-=2;
		m-=2;
		k+=floor((m*n)/2);
		cout<<endl<<k;
	}
}