#include <bits/stdc++.h>

using namespace std;

unsigned long long foo(long long n, long long m) {
    if(n == 1)
        return m;
    if(m == 1)
        return n;

    unsigned long long r1 = 2 * (n + m) - 4;
    unsigned long long r2 = (n - 2)*(m - 2);

    if(r2 % 2 == 0)
        return r1 + r2/2;
    return r1 + (r2 - 1)/2;
}

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

    cout << foo(n,m) << endl;
    return 0;
}