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

namespace ConsoleApp2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] st = Console.ReadLine().Split(' ');
            Int64 n = int.Parse(st[0]), m = int.Parse(st[1]);
            Int64 r = 0;
            if (m == 1)
            {
                r = n;
            }
            else if (n == 1) 
            {
                r = m;
            }
            else
            {
                r = 2 * n + 2 * (m - 2);
                n -= 2;
                m -= 2;
                //r += Math.Floor(n * ((double)m / 2));
                if (m % 2 == 0) 
                {
                    r += n * (m / 2);
                }
                else
                {
                    r += (n / 2) * m + (n % 2) * (m / 2);
                }
            }
            Console.WriteLine(r);
        }
    }
}