#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const double EPS = 1E-6;
const ll MOD = 1000000007;
const ll HIGH = 4611686018427387904; // 2^62

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll n, m;
    cin >> n >> m;
    ll p = n-2, q = m-2;
    cout << n*m - ( ((p+1)/2) * ((q+1)/2) + (p/2) * (q/2) );
}
/*
    Overflow?
    n = 1, n = 0, n = max
    array bound?
    a*b/c != a*(b/c) !!!
*/