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

namespace Redari
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] red = Console.ReadLine().Split(' ');
            int n = int.Parse(red[0]);
            int m= int.Parse(red[1]);
            Console.WriteLine(2 * m + 2 * (n - 2) + ((n - 2) * (m - 2)) / 2);
        }
    }
}