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

signed main(){
	int n, m;
	cin >> n >> m;
	if(n==1 || m==1){
		cout << m*n << '\n';
		return 0;
	}
	int ans=2*(n+m-2);
	n-=2;
	m-=2;
	cout << ans+(n*m)/2 << '\n';
}