using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Finale
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split();
            long N =int.Parse(unos[0]);
            long M = int.Parse(unos[1]);
            long rez= 2 * N + 2 * (M - 2);
            if (M == 1 & N == 1)
            {
                Console.WriteLine(1);
            }
            else
            {

                if (N % 2 == 0 && M % 2 == 0)
                {
                    rez += (M - 2) * ((N - 2) / 2);
                }
                else if (N % 2 == 0)
                {
                    rez += ((N - 2) / 2) * ((M - 3) / 2);
                    rez += ((N - 2) / 2) * ((M - 3) / 2 + 1);
                }
                else if (M % 2 == 0)
                {
                    rez += (N - 2) * ((M / 2) - 1);
                }
                else
                {
                    rez += ((N - 3) / 2 + 1) * ((M - 3) / 2);
                    rez += ((N - 3) / 2) * ((M - 3) / 2 + 1);
                }
            }
            Console.WriteLine(rez);
        }
    }
}