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

namespace ConsoleApp1
{
    class Program
    {

        static ulong Broj(ulong r, ulong k)
        {
            ulong a = (k - 2) / 2, b = a + (k - 2) % 2;
            ulong c = (r - 2) / 2, d = c + (r - 2) % 2;
            return 2 * (k + r - 2) + a * d + c * b;
        }

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            ulong r = ulong.Parse(s[0]), k = ulong.Parse(s[1]);
            if (r == 1 || k == 1)
            {
                Console.WriteLine(r * k);
            }
            else
            {
                Console.WriteLine(Broj(r, k));
            }
        }
    }
}