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

namespace Takm_kvalif_2_zad2
{
    class Program
    {
        static void Main(string[] args)
        {
            int n, m, br = 0;
            n = Convert.ToInt32(Console.ReadLine());
            m = Convert.ToInt32(Console.ReadLine());
            bool[] a = new bool[m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                {
                    if (i == 0 || i == n - 1 || j == 0 || j == m - 1) br++;
                    else if (i % 2 != 0 && j % 2 == 0) br++;
                    else if (i % 2 == 0 && j % 2 != 0) br++;
                }
            Console.WriteLine(br);
            Console.ReadKey();
        }
    }
}