#include <iostream>

using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long int S, N, M;
    cin >> N >> M;
    if (N == 1 || M == 1)
    {
        cout << max(N, M);
    }
    else
    {
        S = (N + M - 2) * 2;
        cout << S + (static_cast<long long>(N * M) - S) / 2;
    }
}