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

    namespace ConsoleApp37
    {
        class Program
        {
            static void Main(string[] args)
            {
                string s = Console.ReadLine();
                int n = int.Parse(s.Split(' ')[0]);
                int m = int.Parse(s.Split(' ')[1]);
                if (n == 1) Console.WriteLine(m);
                else if (m == 1) Console.WriteLine(n);
                else Console.WriteLine(((2 * n + 2 * m) - 4) + ((n * m - ((2 * n + 2 * m) - 4)) / 2));
            
                
            }
        }
    }