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

namespace zadatak2
{
    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]);

            int zbir = 0;

            if (n > 1 && m > 1)
            {
                zbir = (n - 1) * 2 + (m - 1) * 2 + ((n - 2) * (m - 2))/2;
            }
            else if (n > 1 && m == 1)
                zbir = n;
            else if (n == 1 && m > 1)
                zbir = m;

            Console.WriteLine(zbir);
        }
    }
}