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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[]ulaz = Console.ReadLine().Split(' ');
            long tribinaX = long.Parse(ulaz[0]);
            long tibinaY = long.Parse(ulaz[1]);
            Console.WriteLine(tribinaX * 2 + (tibinaY - 2) * 2 + (tribinaX - 2) * (tibinaY - 2) / 2);
            Console.ReadLine();
        }
    }
}