using System;
public class Program
{
    
    public static void Main()
    {
        string[] str = Console.ReadLine().Split();
        int a = int.Parse(str[0]);
        int b = int.Parse(str[1]);
        int c = 2 * (a + b) - 4 + ((a - 2) * (b - 2) / 2);
        Console.WriteLine(c);
    }
}