#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ll n, m;
    cin >> n >> m;
    ll resenje = n * m - (n - 2) * (m - 2) + (n - 2) * (m - 2) / 2;
    cout << resenje;
}