#include <bits/stdc++.h>

using namespace std;

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    long long n, m;

    cin >> n >> m;

    if(n == 1) cout << m << '\n';
    else if(m == 1) cout << n << '\n';
    else{
        long long x = (long long) ceil((n-2) / 2.0), ans = ((m-2) / 2) * x;
        ans += (long long) ceil((m-2) / 2.0) * (n-2-x);
        cout << 2*m + 2*(n-2) + ans << '\n';
    }

    return 0;
}