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

namespace ConsoleApplication2
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] str = s.Split(' ');
            long a;
            long b;
            a = int.Parse(str[0]);
            b = int.Parse(str[1]);
            long o = (a + b) * 2 - 4;
            a = a - 2;
            b = b - 2;
            if (a < 0 || b < 0)
            {
                Console.WriteLine(Math.Max(a + 2, b + 2));
            }
            else
            {
                if (a * b % 2 == 0)
                {
                    Console.WriteLine(o + a * b / 2);
                }
                else
                {
                    Console.WriteLine(o + (a * b - 1) / 2);
                }
            }
         



        }
    }
}