#include <iostream>

using namespace std;

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