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