#include <iostream>
#include <vector>
using namespace std;

int n, m;

int main(void) {

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

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

    int 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;
}