using System;

namespace Takmicenje18._12
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] st = Console.ReadLine().Split();
            int n = int.Parse(st[0]);
            int m = int.Parse(st[1]);
            if (n == 1 && m == 1) Console.WriteLine("1");
            else Console.WriteLine(n * m - (n - 2) * (m - 2) + (n - 2) * (m - 2) / 2);
        }
    }
}