#include <bits/stdc++.h>
using namespace std;

long long int n, m;
const long long int a = 2, b = 4;
int main()
{
    cin >> n >> m;

    if (n != 1 and m != 1)
        cout << a * n + a * m - b + ((n - a) * (m - a)) / a << endl;
    else if (n == 1 or m == 1)
        cout << max(n, m) << endl;
    return 0;
}