using System;

namespace kvalifikacije_2_2022_2023_finale
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            float a = float.Parse(s[0]);
            float b = float.Parse(s[1]);

            float ivice = a * 2 + (b - 2) * 2;
            float ost = Convert.ToInt32(Math.Floor(((a - 2) * (b - 2)) / 2));
            Console.WriteLine(ivice + ost);
        }
    }
}