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

namespace _2.zadatak
{
    internal class Program
    {
        static void Main()
        {
            long[] nm = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
            if (nm[0] == 1) Console.WriteLine(nm[1]);
            else if(nm[1] == 1) Console.WriteLine(nm[0]);
            else Console.WriteLine(nm[0] * nm[1] / 2 + nm[0] + nm[1] - 2);
        }
    }
}