/**
        ______________________
      AnTi-MiRaGe on Anti-Mage xD
      --------------------------
**/
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <iomanip>
#include <utility>
#include <memory.h>
#include <math.h>
#include <time.h>
#include <assert.h>
#include <vector>
#include <set>
#include <map>

#define fr first
#define sc second
#define pb push_back
#define mk make_pair
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define show puts("Debug")
#define int long long

using namespace std;

int a, b;

main()
{
    cin >> a >> b;
    cout << abs(a - 2) * abs(b - 2) << endl;
}
