#include <bits/stdc++.h>

using namespace std;
unsigned long long n,m,br;
int main(){
   cin>>n>>m;
   br=0;
   br=2*m+2*(n-2);
   m-=2;
   n-=2;
   br+=(n/2)*m;
   if (n%2==1) br++;
   cout<<br<<endl;

   return 0;
}