#include <iostream>
#include <cstdio>

using namespace std;
typedef long long LL;

int main()
{
    LL n,m;
    while(scanf("%lld%lld",&n,&m)==2){
        if(n>=2) n=n-2;
        if(m>=2) m=m-2;
        printf("%lld\n",n*m);
    }
    return 0;
}
