#include <iostream>

using namespace std;

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