using System;

namespace zad2
{
    class Program
    {
        static void Main(string[] args)
        {
            long n, m;
            string[] red = Console.ReadLine().Split();
            n = Convert.ToInt32(red[0]);
            m = Convert.ToInt32(red[1]);
            long obod = 2 * n + 2 * m - 4;
            long resenje = (n * m - obod) / 2 + obod;
            Console.WriteLine(resenje);
        }
    }
}