#include <iostream>
#include <cstdio>
#define abs(p) (p > 0 ? p : -(p))
using namespace std;

typedef long long ll;
ll n, m;
int main()
{
	cin >> n >> m;
    cout << abs(n - 2) * abs(m - 2) << endl;
    return 0;
}