using System;
using System.Numerics;
class Program
{
    
    static void Main()
    {
        var niska1 = Console.ReadLine().Split();
        Int64 n = Int64.Parse(niska1[0]);
        Int64 m = Int64.Parse(niska1[1]);
        if(n == 1 && m == 1)
        {
            Console.WriteLine(1);
        }
        else
        {
            Int64 okvir = n * 2 + (m - 2) * 2;
            Int64 unutrasnja_matrica = (n - 2) * (m - 2) / 2;
            Console.WriteLine(okvir + unutrasnja_matrica);
        }
    }
}