#include <iostream>

using namespace std;

int main()
{
 int m,n;
 long long uc;
 cin>>n>>m;
 if(n<3 || m<3)
    uc=m*n;
 else
 {
 uc=n*2+(m-2)*2;
 n=n-2;
 m=m-2;
 uc=uc+(n/2)*m+(n%2)*(m/2);
 }
 cout<<uc;
 return 0;
}