#include <iostream>

using namespace std;

int main()
{
    int n,m;
    scanf("%d%d",&n,&m);
    int n1=n-2, m1=m-2,spr,ind;
    if (n1%2==0){
        spr=n1/2;
        ind=0;
    }else{
        spr=n1/2;
        ind=1;
    }
    if(m1%2==0){
        cout<<2*(n+m-2)+m1/2*(spr+ind)+m1/2*spr;
    }else{
        cout<<2*(n+m-2)+m1/2*(spr+ind)+(m1/2+1)*spr;
    }
}