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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int m = int.Parse(Console.ReadLine());
            int[,] sed = new int[n, m];
            int zbir = n * 2 + m * 2 - 4;
            if (n % 2 == 0)
                zbir += (n - 2) / 2 * (m - 2);
            else if (m % 2 != 0)
                zbir += ((n - 2) / 2) * ((m - 2) / 2 + 1) + ((n - 2) / 2 + 1) * ((m - 2) / 2);
            else
                zbir += ((n - 2) / 2) * ((m - 2) / 2) + ((n - 2) / 2 + 1) * ((m - 2) / 2);

            Console.WriteLine(zbir);
            Console.ReadLine();
        }
    }
}