#include <bits/stdc++.h>
using namespace std;

int main()
{
    int w, h;
    int zbir = 0;
    cin >> h >> w;
    zbir += h * 2 + w * 2 - 4;
    w -= 2;
    h -= 2;
    zbir += (h / 2) * (w);
    if(h % 2 == 1) {
        zbir += w / 2;
    }
    cout << zbir << endl;
    return 0;
}