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

namespace ConsoleApp9
{
    class Program
    {
        static void Main(string[] args)
        {
            string pomocna = Console.ReadLine();
            string[] red = pomocna.Split(' ');
            int n = int.Parse(red[0]);
            int m = int.Parse(red[1]);
            int br;
            if (n == 1 && m == 1)
                br = 1;
            else
                br = (2 * m + 2 * (n - 2)) + ((m - 2) * (n - 2) / 2);                
            Console.WriteLine("{0}", br);
            Console.ReadLine();
        }
    }
}