using System;
namespace takmicenje
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            int r = 2 * n + (m - 2) * 2;
            if (n % 2 == 0) r += (m - 2) * (n - 2) / 2;
            else r += (n - 2) / 2 * ((m - 2) / 2 + 1) + (m - 2) / 2 * ((n - 2) / 2 + 1);
            Console.WriteLine(r);
        }
    }
}