using System;

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

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