#include <bits/stdc++.h>

#define ll long long

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n, m;
    cin >> n >> m;

    if (n == 1) {
        cout << m << "\n";
        return 0;
    } else if (m == 1) {
        cout << n << "\n";
        return 0;
    }

    ll ivice = 2 * m + 2 * n - 4;
    n-=2;
    m-=2;
    ll black = floor(n * m) / 2;
    ll white = n * m - black;
    
    cout << ivice + (min(black, white)) << "\n";
}