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

namespace ConsoleApp6
{
    internal class Program
    {
        static void Main(string[] args)
        {
            string ns = Console.ReadLine();
            int N = int.Parse(ns.Split(' ')[0]);
            int M = int.Parse(ns.Split(' ')[1]);
            int r = 0;
            int sr = 0;
            int iv = 0;
            if(N==1 || M==1)
            {
                r = N * M;
            }
            else
            {
                iv = (N * 2 + M * 2) - 4;
                sr = (N * M - iv) / 2;
                r = iv + sr;
            }
            Console.WriteLine(r);
        }
    }
}