#include <iostream>
#include <cmath>
using namespace std;
int main(){
    double y,x;
    cin>>y>>x;
    int brl;
    if(x<3 || y<3){
        cout<<x*y;
    }
    else {
        brl=ceil((x-2)*(y-2)/2);
        cout<<x*y-brl;
    }

}