using System;

namespace ConsoleApp30
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, m;
            string s = Console.ReadLine();
            n = Int32.Parse(s.Split(" ")[0]);
            m = Int32.Parse(s.Split(" ")[1]);
            n -= 2;
            m -= 2;
            Console.WriteLine(2 * (n + m + 2) + (n / 2) * (m) + (n % 2) * (m / 2));
        }
    }
}