using System;

namespace ConsoleApp46
{
    internal class Program
    {
        static void Main(string[] args)
        {
           string[] x = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(x[0]);
            int b = Convert.ToInt32(x[1]);
            if (a == 1 || b == 1)
            {
                Console.WriteLine(Math.Max(a, b));
            }
            else Console.WriteLine(2*a + 2*(b-2) +(a-2)*(b-2)/2);
        }
    }
}