#include<bits/stdc++.h>
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int a,b;
    cin >> a >> b;
    int x;
    x = 2 * a + 2 * b - 4;
    cout << x + (((a * b) - x) / 2) << "\n";
}