//  ? ? ? ? ? ? ?
//  ? @roadfromroi ?
//  ? ? ? ? ? ? ?
#include <iostream>
#include "vector"
#include "algorithm"
#include "numeric"
#include "climits"
#include "iomanip"
#include "bitset"
#include "cmath"
#include "map"
#include "deque"
#include "array"
#include "set"
#define all(x) x.begin(), x.end()
using namespace std;
#define int long long
void solve() {
    int x, y, res;
    cin >> x >> y;
    res = x * y;
    x -= 2;
    y -= 2;
    int t = 0;
    if (x > 0 and y > 0)
        t = (x * y + 1) / 2;
    res -= t;
    cout << res << '\n';
}
signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int t = 1;
    while (t--) {
        solve();
    }
}