#include <iostream>

using namespace std;

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

    return 0;
}