using System;
using System.Collections.Generic;
using System.Linq;

namespace Petlja2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s1 = Console.ReadLine().Split(' ');
            Int64 n = int.Parse(s1[0]);
            Int64 m = int.Parse(s1[1]);
            Int64 p = n * m;
            if (n == 1 && m == 1)
                Console.WriteLine(1);
            else if (n == 1 || m == 1)
                Console.WriteLine(p);
            else
                Console.WriteLine(((p - ((n + m) * 2 - 4)) / 2) + ((n + m) * 2 - 4));
        }
    }
}