#include <iostream>

using namespace std;

long long int m, n;

void Unos(){
    cin>>m>>n;
}

long long int Resenije(){
    long long int br=0;
    br=2*(m+n)-4;
    m-=2;
    n-=2;
    br+=(m*n)/2;
    return br;
}

int main()
{
    Unos();
    cout<<Resenije();
}