#include <iostream>

using namespace std;

int main()
{
    long long n, m;
    cin >> n >> m;

    if (n < 3 || m < 3) {
        cout << n * m;
    } else {
        long long br = (n - 2) * (m - 2);
        long long resenje = (n * m) - (br / 2) - (br % 2);
        cout << resenje;
    }

    return 0;
}