#include <iostream>

using namespace std;

int main()
{
    int n, m, redari;
    cin >> n >> m;

    if (n == 1 && m == 1)
        redari = 1;

    else {
        int brs, bru;

        if (n == 1 || m == 1){
            redari = max(n, m);
        }
        else {
            brs = n*2 + (m-2)*2;

            int Pu = (n-2)*(m-2);


            bru = Pu/2;
            redari = brs + bru;
        }

    }

    cout << redari;

    return 0;
}