#include<bits/stdc++.h>

using namespace std;


int main() {
    ios_base::sync_with_stdio(false);
    long long n, m, ans(0), p;
    cin >> n >> m;
    p = n * m;
    ans += 2 * n + 2 * m - 4;
    p -= ans;
    ans += p / 2;
    cout << ans;






    return 0;
}