#include <iostream>

using namespace std;

int main()
{
    int n,m;
    cin>>n>>m;
    long long f;
    if(n==1&&m!=1)
        f=m/2;
    else if(m==1&&n!=1)
        f=n/2;
    else if(n==1&&m==1)
        f=1;
    else
        f=(long long)2*n+(long long)2*(m-2)+(long long)((n-2)*(m-2))/2;
    cout<<f;
    return 0;
}