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

int main(){
    ios_base::sync_with_stdio(0);

    long long n,m,z = 0;
    cin >> n >> m;
    z += n*2+(m-2)*2;
    n -= 2;
    m -= 2;
    z += (n/2)*(m-m/2)+(n-n/2)*(m/2);
    cout << z;
}