using System;

class Program
{
    static void Main()
    {
        string[] red = Console.ReadLine().Split(' ');

        long a = long.Parse(red[0]);
        long b = long.Parse(red[1]);

        Console.WriteLine((a * b + 2 * (a + b) - 4) / 2);
        Console.ReadLine();
    }
}