#include <iostream>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    int u=n*m;
    int nav=(n-2)*(m-2)/2+(m*n)%2;
    if(n==1 or m==1 or n==2 or m==2)nav=0;
    cout<<u-nav;
    return 0;
}