#include <iostream>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int n2 = n - 2, m2 = m - 2;
    bool dn = n % 2 != 0, dm = m % 2 != 0;
    cout << 2 * m + 2 * (n - 2) + (m2 / 2) * (n2 / 2 + dn) + (m2 / 2 + dm) * (n2 / 2);


    return 0;
}