using System;

namespace ConsoleApp1
{
    internal class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            string[] red = Console.ReadLine().Split(' ');
            a = int.Parse(red[0]);
            b = int.Parse(red[1]);
            if (a == 1)
                Console.WriteLine(b);
            else if (b == 1)
                Console.WriteLine(a);
            else
                Console.WriteLine(2 * a + (b - 2) * 2 + ((a - 2) * (b - 2) / 2));
            Console.ReadLine();
        }
    }
}