#include <bits/stdc++.h>


using namespace std;

int main() {
  long long N, M;
  cin >> N >> M;
long long a=((N-2)*(M-2))/2;

 if (N%2!=0 and M%2!=0)
 a=a+1;
  if(M==1 and N==1){
    cout<<"1"<<endl;
    return 0;
 }
 else if(N==1){
    cout<<M<<endl;
    return 0;
 }
 else if(M==1){
    cout<<N<<endl;
    return 0;
 }

  long long cuvari = (N * M ) - a ;
  cout << cuvari << endl ;

  return 0;
}