#include <bits/stdc++.h>
using namespace std;
int n,m;
long long res;
int main (){
    cin>>n>>m;
    if(n==1 and m==1)cout<<1<<endl;
    else if(n==1)cout<<m<<endl;
    else if(m==1)cout<<n<<endl;
    else {
            res=(2*n+2*m)-4+((n*m-((2*n+2*m)-4))/2);
            cout<<res<<endl;
    }
return 0;
}