using System;

namespace Finale
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = Convert.ToInt32(s[0]);
            int m = Convert.ToInt32(s[1]);
            if(n == 1)
            {
                Console.WriteLine(m);
            }
            else if(m == 1)
            {
                Console.WriteLine(n);
            }
            else
            {
                Console.WriteLine(2 * n + 2 * (m - 2) + (n - 2) * (m - 2) / 2);
            }
        }
    }
}