using System;

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            uint n = Convert.ToUInt32(s[0]);
            uint m = Convert.ToUInt32(s[1]);

            ulong x = 2 * m + (n - 2) * 2 + ((m - 2) * (n - 2)) / 2;
            Console.WriteLine(x);
        }
    }
}