#include <iostream>
#include <cmath>

using namespace std;

int main() {
    int a, b, c = 0;
    cin >> a >> b;

    if(a == 1 || b == 1) c = a*b;
    else c = 2*(a+b-2) + (a-2)*(b-2)/2;
    cout << c;
}