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

namespace Takmicenje_3___2__Redari_
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split();
            long n = Convert.ToInt64(s[0]);
            long m = Convert.ToInt64(s[1]);
            Console.WriteLine(2 * (n + m) - 4 + (n * m - 2 * (n + m) + 4) / 2);
        }
    }
}