#include <bits/stdc++.h>

using namespace std;

int main()
{
    double n,m;
    cin>>n>>m;
    if(n <= 2 || m<=2){
        cout<<n*m<<endl;
        return 0;
    }
    int pov=m*n;
    m-=2;
    n-=2;
    cout<<pov-(ceil(m*n/2))<<endl;
    return 0;
}