using System;

namespace ConsoleApp67
{
    class Program
    {
        static void Main(string[] args)
        {
            string t = Console.ReadLine();
            string[] t1 = t.Split(' ');
            long a = long.Parse(t1[0]);
            long b = long.Parse(t1[1]);
            if (a == 1)
            {
                Console.WriteLine(b);
            }
            else
            {
                if (b == 1)
                    Console.WriteLine(a);
                else



                    Console.WriteLine(2 * a + 2 * b - 4 + (a - 2) * (b - 2) / 2);
                

            }
        }
    }
}