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