#include <iostream>
using namespace std;
int n, m;
int main()
{
    cin >> n >> m;
    if(n == 1 && m == 1)
        cout << 1 << endl;
    else
    {
        int o = 2 * (m + n) - 4;
        int nu = n -2; int mu = m -2;
        cout << o + (nu * mu) / 2 << endl;   
    }
    
    return 0;
}