#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    long long n, m;
    cin >> n >> m;
    long long P = n * m;
    long long O;
	if(n == 1) O = m;
    else if(m == 1) O = n;
    else O = (n + m - 2) * 2;
    cout << O + (P - O) / 2;
    return 0;
}