using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Zadatak2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long n = long.Parse(s[0]);
            long m = long.Parse(s[1]);

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