#include <iostream>

using namespace std;

int main()
{
    long long n, m;

    cin >> n >> m;

    long long res = n * m;

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

        long long p;

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

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

        res -= p;

    }

    cout << res;

    return 0;
}