#include <bits/stdc++.h>
using namespace std;

int main()

{
    long long n,m;
    cin>>n>>m;
    long long br=0;
    if(n==1 && m==1)
        br=1;
    else if(n%2==1 && m%2==1)
        br=2*(n+m-2)+((n-2)*(m-2)-1)/2;
    else
        br=2*(n+m-2)+(n-2)*(m-2)/2;

    cout<<br;
return 0;
}