#include <stdio.h>
#include <stdlib.h>

int main()
{
    int n,m,nova,br,resenje;
    scanf("%d %d",&n,&m);
    if(n==1 || m==1){
        resenje = m+n-1;
    }else{
    nova=n*m-(2*(n-1)+2*(m-1));
    br=2*n+2*m-4;
    resenje =br+nova/2;
    }
    printf("%d",resenje);
    return 0;
}