#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, br = 0;
    cin>>n>>m;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
        {
            if (i == 0 || i == n - 1 || j == 0 || j == m - 1) br++;
            else if (i % 2 != 0 && j % 2 == 0) br++;
            else if (i % 2 == 0 && j % 2 != 0) br++;
        }
    cout<<br;
    return 0;
}