#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long n;
    long long m;

    cin >> n;
    cin >> m;

    unsigned long long p = n * m;

    unsigned long long res = (2 * n) + (2 * m) - 4 + ((p - (2 * m) - (2 * n) + 4) / 2);

    cout << res << '\n';

    return 0;
}