using System;
using System.Collections.Generic;
namespace takmicenjeKvalifikacije
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] sr = Console.ReadLine().Split();
            long n = long.Parse(sr[0]), m = long.Parse(sr[1]);

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