#include <stdio.h>
int main()
{
    unsigned result;
    unsigned x, y;
    scanf("%i%i", &x,&y);
    result = ((x<<1) + ((y-2)<<1));
    x -= 2;
    y -= 2;
    result += ((x*y)>>1);
    printf("%u", result);
    return 0;
}