#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    int r;
    if (n <= 2 || m <= 2)
    {
        r = n * m;
    }
    else
    {
        r = 2 * (n + m - 2) + ((m - 2) / 2) * (n - 2) + ((m - 2) / 2) * (n - 2) / 2;
    }
    cout << r;
    return 0;
}