#include <stdio.h>
#include <stdlib.h>
int main(){
    int N, M, broj_redara, i, j;
    scanf("%d %d", &N, &M);
    int matrica[N][M];
    broj_redara = 2 * (M + N) -4;
    for(i=1; i<N-1; i++)
        for(j=1; j<M-1; j++)
            if(i%2==0 && j%2!=0 || j%2==0 && i%2!=0)
                broj_redara++;
    printf("%d", broj_redara);
    return 0;
}