#include <iostream>
using namespace std;

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