#include <iostream>
using namespace std;

int main()
{
    int n, m;
    long long int ans;
    cin >> n >> m;
    ans = (2 * n + 2 * (m - 2)) + abs(((m * n - (2 * n + 2 * (m - 2))) / 2));
    cout << ans;
}