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

int main()
{
    long long int n, m;
    scanf("%lld %lld", &n, &m);
    long long int k, s, p;
    k=(n-2)*(m-2);
    if(k%2!=0)
        k=k-1;
    s=2*m+2*(n-2);
    p=s+k/2;
    printf("%lld", p);
    return 0;
}