#include <iostream>
#include <cmath>
int main() {
    int n, m;
    std::cin >> n >> m;
    if(n == 1 and m == 1){

        std::cout << 1;
        return 0;

    }
    if(m == 1 or n == 1){

        std::cout << std::max(m, n);
        return 0;

    }
    std::cout << n * m - ((n - 2) * (m - 2)) + ((n - 2) * (m - 2)) / 2;
    return 0;
}