using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;
namespace ConsoleApp6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] s1 = s.Split(" ");
            ulong x = ulong.Parse(s1[0]);
            ulong y = ulong.Parse(s1[1]);
            Console.WriteLine(2 * x + 2 * (y-2) + ((x-2) * (y-2) / 2));

            
            


        }
    }
}