#include <bits/stdc++.h>
using namespace std;

long long n,m;

void program(long long n, long long m){
  if(n == 1 || m == 1){
    long long x = n*m;
    printf("%lld\n",x);
  }
  else{
    long long y = (2*n+2*m-4)+((n-2)*(m-2))/2;
    printf("%lld\n",y);
  }
}

int main(){
  scanf("%lld%lld",&n,&m);
  program(n,m);

  return 0;
}