#include <iostream>

int main()
{
    int m, n, brRedara;

    std::cin >> m >> n;

    if((m % 2) > 0 && (n % 2) > 0)
    {
        brRedara = 2*m + (n - 2)*2 + ((m-2)*(n-2) - 1) / 2;
        std::cout << brRedara;
    }

    else
    {
        brRedara = brRedara = 2*m + (n - 2)*2 + ((m-2)*(n-2)) / 2;
        std::cout << brRedara;
    }

    return 0;
}