#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

int main() {
    ull n, m, sol = 0;
    cin >> n >> m;
    sol += 2 * (n + m - 2);
    n -= 2;
    m -= 2;
    sol += (m / 2) * n;
    if(m % 2) sol += n / 2;
    cout << sol << endl;
    return 0;
}