#include <bits/stdc++.h>
using namespace std;
long long a,b,br,k,rez,d;
int main(){
   cin >> a >> b;
   br=2*a+2*b-4;
   d=a*b-br;
   if (d%2==0){
      rez=br+d/2;
   }
   else {
      k=floor(d/2);
      rez=br+k;
   }
   cout << rez << endl;

return 0;
}