#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
    cin>>a>>b;
    if(a==1||b==1)
        cout<<max(a,b)<<endl;
    else
        cout<<2ll*(a+b)-4+(a-2)*((b-3)/2)+(a-2)/2<<endl;
    return 0;
}