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

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