#include <bits/stdc++.h>
using namespace std;
long long N,M,okvir,povrsina,res;
int main(){
 cin>>N>>M;
 if(N==M and N==1){
  res=1;
 }
 else if(N==1 and N!=M){
  res=M;
 }
 else if(M==1 and N!=M){
  res=N;
 }
 else{
  okvir=2*(N+M)-4;
  povrsina=N*M;
  res=okvir+(povrsina-okvir)/2;
 }
 cout<<res<<endl;
 return 0;
}