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

int main(){
    int r, k;
    cin>>r>>k;
    if(r==1 || k==1)
        cout<<max(r, k);
    else{
        int res=(2*r+2*k-4)+(r*k-(2*r+2*k-4))/2;
        cout<<res;
    }
    
    return 0;   }