#include <bits/stdc++.h>
using namespace std;
long long n,m,sol,ivice;
int main(){
  cin >> n >> m;
  ivice=max(n<<1,(long long)0)+max((m<<1)-4,(long long)0);
  sol=(n*m-ivice)/2+ivice;
  cout << sol << "\n";
}