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

namespace takmicenjeDrugiKrugDrugiZadatak
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            int n = int.Parse(s[0]);
            int m = int.Parse(s[1]);
            int[,] matrica = new int[n, m];
            int k = 1;
            for (int i = 0; i < n; i++)
            {
                for (int j = 0; j < m; j++)
                {
                    matrica[i, j] = k;
                    k++;
                }
            }
            int z = 2 * n + 2 * m - 4;
            int q = 0;
            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)
                    {
                        matrica[i, j] = 0;
                    }
                    else
                    {
                        if (matrica[i - 1, j] == 0 && matrica[i,j-1] == 0)
                        {
                            q++;
                            matrica[i, j] = 0;
                        }
                    }
                }
            }
            z += q / 2;
            Console.WriteLine(z);
            Console.ReadLine();
        }
    }
}