using System;

namespace takmicenje_2_br_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s=Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            if (n == 1 && m == 1)
            {
                Console.WriteLine(1);
            }
            else
            {
                int z = 2 * n + 2 * m - 4;
                int g = n * m - z;
                Console.WriteLine(g / 2 + z);
            }
            Console.ReadLine();
        }
    }
}