#include <iostream>

using namespace std;

int main()
{

    unsigned long long int r=0;
    int n, m;
    cin>>n>>m;
    r+=2*m;
    r+=2* (n-2);
    m-=2;
    n-=2;
    r+=(n*m)/2;
    cout<<r;


    return 0;
}