using System;

namespace P_2022_2_2
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] temp1 = Console.ReadLine().Split(' ');
            int n = Convert.ToInt32(temp1[0]);
            int m = Convert.ToInt32(temp1[1]);
            int[,] matrix = new int[n, m];
            for (int i = 0; i < n; i++)
                for (int j = 0; j < m; j++)
                    matrix[i, j] = 0;
            for (int i = 0; i < n; i++)
            {
                matrix[i, 0] = 1;
                matrix[i, m - 1] = 1;
            }
            for (int i = 0; i < m; i++)
            {
                matrix[0, i] = 1;
                matrix[n - 1, i] = 1;
            }
            int seged1;
            int seged2 = 0;
            for (int i = 1; i < n - 1; i++)
            {
                if (seged2 == 0)
                {
                    seged1 = 1;
                    seged2 = 1;
                }
                else
                {
                    seged1 = 0;
                    seged2 = 0;
                }
                for (int j = 1; j < m - 1; j++)
                {
                    if (seged1 == 0)
                    {
                        matrix[i, j] = 1;
                        seged1 = 1;
                    }
                    else
                        seged1 = 0;
                }
            }
            int eredmeny = 0;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                    if (matrix[i, j] == 1)
                        eredmeny++;
            }
            Console.WriteLine(eredmeny);
        }
    }
}