#include <iostream>

using namespace std;

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