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

namespace ConsoleApp8
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] unos = Console.ReadLine().Split();
            int n = int.Parse(unos[0]);
            int m = int.Parse(unos[1]);
            int poredu1;
            int poredu2;
            int res = 2 * m + 2 * (n - 2);
            if (m % 2 == 1)
            {
                poredu1 = (m-2) / 2 ;
                poredu2 = poredu1 +1;
            }
            else
            {

                poredu1 = (m-2) / 2;
                poredu2 = poredu1;
            }
            
            if (n == 1) res = m;
           else if (m == 1) res = n;
           else if (n % 2 == 0 && n>2 && m>2)
            {
                res = res + ((n - 2) / 2) * (poredu1 + poredu2);
            }
            else if (n % 2 == 1 && n > 2 && m > 2)
            {
                res = res + ((n - 2) / 2) * (poredu1 + poredu2) + poredu1;
            }
            Console.WriteLine(res);
        }
    }
}