#include <bits/stdc++.h>
using namespace std;
unsigned long long a,b,R,O,U;
int main(){
cin>>a>>b;
  R=(a*2+(b-2)*2);
  O=(a*b-R)/2;
  U=R+O;
  if (a==1 or b==1)
      cout<<max(a,b)<<endl;
  else
    cout<<U<<endl;
return 0;}