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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            long n, m;
            string[] inp = Console.ReadLine().Split();
            n = long.Parse(inp[0]);
            m = long.Parse(inp[1]);

            if (n == 1)
                Console.WriteLine(m);
            else
                if (m == 1)
                    Console.WriteLine(n);
                else
                    Console.WriteLine((2 * n + 2 * m - 4 + (n - 2) * (m - 2) / 2));
            Console.Read();
        }
    }
}