#include <iostream>
using namespace std;

int main()
{
    long int n,m,k,p;
    cin>>n>>m;
    k = (n-2)*(m-2);
    p = n*m;
    if(k<=0||(n==1&&m==1)||n==0||m==0){
        cout<<p;
    }
    else if(k%2==0){
       cout<<p-(k/2); 
    }
    else{
        cout<<p-(k/2)-1;
    }
    return 0;
}