using System;

namespace App
{
    internal class Program
    {
        static void Main(string[] args)
        {
        string[] ab=Console.ReadLine().Split();
        long a = long.Parse(ab[0]);
        long b = long.Parse(ab[1]);
        Console.WriteLine( 2*(a+b)+(a-2)*((b-1)/2));
        }
    }
}