#include <iostream>

using namespace std;

int main()
{
    int n,m,br=1,broj;
    cin>>n>>m;
    int a[n][m];
    br=n*m;
    broj=(br-(n*2+m*2)+4)/2;
    br=br-1;
    cout<<br-broj<<endl;
    return 0;
}