using System;

namespace MarkoDva
{
    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]);
            Int64 NM;
            if (M == 1 && N != 0)
                NM = N;
            else if(M!=0 && N==1)
                NM = M;
            else
            NM = N * 2 + (M - 2) * 2 + (N - 2) * (M - 2) / 2;
            Console.WriteLine(NM);
        }
    }
}