using System;

namespace Finale
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] ulaz = Console.ReadLine().Split();
            int m = int.Parse(ulaz[0]);
            int n = int.Parse(ulaz[1]);
            if (m == 1 || n == 1 || m == 2 || n == 2) Console.WriteLine(m * n);
            else
            {
                int zbir = 2 * n + 2 * m - 4;
                if (n * m == zbir) zbir = 2 * n + 2 * m - 4;
                else
                {
                    m -= 2;
                    n -= 2;
                }
                if ((n * m) % 2 == 0) zbir += (n * m) / 2;
                else zbir += (n * m - 1) / 2;
                Console.WriteLine(zbir);
            }
        }
    }
}