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

namespace a
{
    class Program
    {

        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long n = int.Parse(s[0]);
            long m = int.Parse(s[1]);
            if(n==1 && m==1) Console.WriteLine(1);
            else
            {
                long r = 2 * (n + m - 2) + (n - 2) * (m - 2) / 2;
                Console.WriteLine(r);
            }
        }
    }
}