#include <iostream>

using namespace std;
int main()
{
    int n,m; cin >> n>>m;
    long long int a[n][m];
    long long int broj = 1;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            a[i][j] = broj;
            broj ++;
        }}
   /* for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cout << a[i][j] << " ";
        }}*/
        int res = 2*n+2*m-4 + (n*m-2*n-2*m+4)/2;
        cout << res;

    return 0;
}