#include <bits/stdc++.h>

using namespace std;

int main()
{
    unsigned long long int x, y, z;
    cin >> x >> y;
    z = 2 * x + (y - 2) * 2;
    z += (x - 2) * (y - 2) / 2;
    cout << z;
    return 0;
}