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

int main() {
    ios::sync_with_stdio(0);cin.tie(0);
    int m, n;
    cin >> m >> n;
    if(m > 2 && n > 2){
        cout << m*n - (m-2)*(n-2)/2-1;
    }else{cout << m*n;}
    return 0;
}