#include <stdio.h>

int main(){
    unsigned long long int n, m;
    scanf("%llu%llu", &n, &m);

    if (n == 1 || n == 2 || m == 1) printf("%llu", m*n);
    else printf("%llu", ((2*m)+((n-2)*2))+(((n-2)*(m-2))/2));

    return 0;
}