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

int main(){
    long long int n, m;
    cin >> n >> m;
    long long int res = 0;
    if (n == 1) res = m;
    else if (m == 1) res = n;
    else {
        res += n * 2 + m * 2 - 4;
        res += (m * n - n * 2 - m * 2 + 4) / 2; }
    cout << res;
    
    return 0;
}