using System;

namespace FINALE
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            Int64 n = Int64.Parse(s[0]), m = Int64.Parse(s[1]);
            if (n == 1 || m == 1)
            { Console.WriteLine(n*m); return; }
            Int64 okvir = 2 * n + 2 * m - 4;
            Int64 ostatak = (n * m - okvir) / 2;
            Console.WriteLine(okvir + ostatak);
        }
    }
}