#include <iostream>
using namespace std;
int main()
{
    long long m, n;
    cin >> m >> n;
    if (n == 1)
        cout << m << endl;
    else if (m == 1)
        cout << n << endl;
    else
        cout << 2 * (m + n - 2) + ((m - 2) * (n - 2) / 2) << endl;
    return 0;
}