#include <iostream>

using namespace std;

int main() {
    unsigned long long int N, M, count;
    cin >> N >> M;

    if (N == 1 && M == 1) {
        count = 1;
    }
    else if (N == 1) {
        count = M;
    }
    else if (M == 1) {
        count = N;
    } else {
        count = 2 * (N + M - 2);
        N -= 2;
        M -= 2;

        if (N > 0 && M > 0) {
            if (N % 2 == 0 || M % 2 == 0) {
                count += (N * M) / 2;
            } else {
                count += M * ((N - 1) / 2) + M / 2;
            }
        }
    }

    cout << count << "\n";

    return 0;
}