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

int main()
{
    long long n, m;
    scanf("%ld %ld", &n, &m);
    if(n==1)
        printf("%ld", m);
    else
        if(m==1)
            printf("%ld", n);
        else
            printf("%ld", 2*(n+m-2)+(n-2)*(m-2)/2);
    return 0;
}