#include<bits/stdc++.h>

using namespace std;

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

    unsigned long long n, m, res, tmp;

    cin >> n >> m;

    res = 2 * m + 2 * (n - 2);
    n-= 2;
    m-= 2;

    if(n % 2 == 0 && m % 2 == 0){
        res += (n / 2) * m;
    }
    else if(n % 2 != 0 && m % 2 != 0){
        res += (n / 2) * (m / 2 + 1) + (n / 2 + 1) * (m / 2);
    }
    else{
        if(n % 2 == 0){
            tmp = n;
            n = m;
            m = tmp;
        }
        res += (n / 2) * (m / 2) + (n / 2 + 1) * (m / 2);
    }

    cout << res;
    return 0;
}