#include <bits/stdc++.h>
 
typedef long long ull; 

using namespace std;

int main(){
    ull n, m;cin >> n >> m;
    ull x = 4 + 2 * (n-2) + 2 * (m-2);
    cout << x + ((n*m) - x) / 2;
    return 0;
}