using System;

namespace finale
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] red = Console.ReadLine().Split();
            int n = Convert.ToInt32(red[0]);
            int m = Convert.ToInt32(red[1]);
            if (m == 1 & n == 1) Console.WriteLine(1); 
            else 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);
        }
    }
}