#include <iostream>
#include <vector>
#define ll long long
using namespace std;

ll n, m;

int main(void) {

    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n >> m;
    vector<vector<bool>> v(n);

    for (int i = 0; i < n; i++) {
        v[i].resize(m, 1);
    }

    ll br = n * m;
    for (int i = 1; i < n - 1; i++)
    {
        for (int j = 1; j < m - 1; j++)
        {
            if(v[i-1][j] && v[i+1][j] && v[i][j-1] && v[i][j+1]) {
                v[i][j] = 0;
                br--;
            }
        }
        
    }

    cout << br << "\n";

    return 0;
}