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