#include<bits/stdc++.h>

using namespace std;

int main(){

    long long j, d;
    cin>> j >> d;
    long long o = (2 * j + 2 * d) - 4;
    long long k = j*d;
    cout<< o + (k - o)/ 2 <<endl;

    if(j == 1 && d == 1){
        cout<<"1"<<endl;
    }


    return 0;
}