#include <iostream>
#include <bits/stdc++.h> 

using namespace std;

int main()
{
    long long int a,b;
cin>>a>>b;
if(b<=2||a<=2){
    cout<<a*b;
}
else{
    long long int c=2*a+2*(b-2);
    cout<<c+((a*b)-c)/2;

}
}