#include <iostream>

using namespace std;
int main()
{
    long long n, m;
    long long resenje;

    long long pom;
    long long pom1;

    cin >> n >> m;
    resenje = 2 * (m - 1) + 2 * (n - 1) + ((m - 2) * (n - 2)) / 2;
    cout << resenje << endl;
    return 0;
}