#include<bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int n, m; cin>>n>>m;
    int s,u;
    s=2*n+2*(m-2);
    u=n*m-s;
    int resenje=s;
    if(u%2==1){
        resenje+=(u-1)/2;
    }else{
        resenje+=u/2;
    }
    cout<<resenje;
}