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

namespace _2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int x, y;
            int rez = 0;

            string[] tmp = Console.ReadLine().Split(' ');
            x = Convert.ToInt32(tmp[0]);
            y = Convert.ToInt32(tmp[1]);

            rez += (x * y) - (((x - 2 > 0) && (y - 2 > 0)) ? ((x - 2) * (y - 2)) : 0);
            if (x-2 <= 0 || y-2<=0)
            {
                Console.WriteLine(rez);
                Console.ReadLine();
                return;
            }

            bool prvi = (x-2 % 2 == 0);
            bool drugi = (y-2 % 2 == 0);

            if (prvi || drugi)
            {
                rez += ((x - 2) * (y - 2)) / 2;
            }
            else
            {
                rez += ((x - 2) * (y - 2)-1) / 2;
            }
            Console.WriteLine(rez);
            Console.ReadLine();
        }
    }
}