#include <iostream>

using namespace std;

int main()
{
    int m,n,redara,mp,np;
    cin >> n >> m;
    if(n==1){
        cout << m << endl;
        return 0;
    }
    else if(m==1){
        cout << n << endl;
        return 0;
    }
    mp=m;
    m=m-2;
    np=n;
    n=n-2;
    redara=mp*2+(np-2)*2+(n/2+n%2)*(m/2)+(n/2)*(m/2+m%2);
    cout << redara << endl;
    return 0;
}