#include<iostream>

using namespace std;

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

}