#include <iostream>

using namespace std;

int main()
{
    int n, m;

    cin >> n >> m;

    int res = n * m;

    if(n > 2 && m > 2){

        int p;

        p = (n - 2) * (m - 2) / 2;

        if(n  % 2 == 1 && m % 2 == 1) p++;

        res -= p;

    }

    cout << res;

    return 0;
}