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

namespace Takmicenje
{
    internal class Program
    {
        static void ucitaj(out long a,out long b)
        {
            a = 0;
            b = 0;
            string s = Console.ReadLine();
            int i;
            for (i = 0; s[i] != ' '; i++)
            {
                a = a * 10 + int.Parse(s[i].ToString());
            }
            i++;
            for (; i < s.Length; i++)
            {
                b = b * 10 +int.Parse(s[i].ToString());
            }
        }
        static void Main(string[] args)
        {
            long a, b;
            ucitaj(out a, out b);
            Console.WriteLine(((a + b)*2-4)+(a*b-(a+b)*2+4)/2);
        }
        
    }
}