#include <iostream>

using namespace std;

int main()
{
    int x, y, jana;
    cin >> x >> y;
    if (x == 1) jana = y;
    else if (y == 1) jana = x;
    else jana = 2*(x + y - 2) + ((x - 2)*(y - 2)) / 2;
    cout << jana;
	return 0;
}