#include <iostream>

using namespace std;

int main ()
{
    cin.tie(NULL);
    ios::sync_with_stdio(false);
	long long x,y;
	cin>>x>>y;
	if(x==1 || y==1)
    {
        cout<<x*y<<endl;
    }
	else
    {
        long long z=2*(x+y)-4;
        long long a=((x*y)-z)/2;
        cout<<a+z<<endl;
	}
	return 0;
}