using System;

class HelloWorld
{
    static void Main()
    {
      
        string[] s1 = Console.ReadLine().Split();
         
        UInt64 x = UInt64.Parse(s1[0]);
        UInt64 y = UInt64.Parse(s1[1]);
        Console.WriteLine(((x-2)*(y-2))/2 + 2*x + 2*(y-2));
       
    }
}