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