#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    long long x;
    cin>>n>>m;
    x=n*m;
    int n1=n-2,m1=m-2;
    int k=n1%2+n1/2;
    int l=m1%2+m1/2;
    long long x1=k*l+(n1-k)*(m1-l);
    x-=x1;
    cout<<x;

    return 0;
}