#include <bits/stdc++.h>

using namespace std;

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