#include <iostream>
using namespace std;
int main()
{
    int N,M,ivice,sredina,sum;
    cin>>N>>M;
    ivice=N+N-2+(2*(M-1));
    sredina=(N*M)-ivice;
    sum=ivice+sredina/2;
    cout<<sum;
    return 0;
}