using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace aaa
{

    class Program
    {
        public static void Main(string[] args)
        {
            ulong[] niz1 = Console.ReadLine().Split(' ').Select(x => ulong.Parse(x)).ToArray();
            ulong n = niz1[1], m = niz1[0];
            ulong num = 2 * n + 2 * m - 4 ;
            ulong value = ((m - 2) % 2 == 0) ? (n - 2)*(m-2)/2 : ((n - 2) * ((m - 2) / 2)) + (n - 2) / 2;
            Console.WriteLine(value);
        }
    }
}