import scala.io.StdIn.{readLine}

object Main extends App {
  val ints = readLine.split(" ").map(_.toInt)
  val result = (ints(0), ints(1)) match {
    case (_, 2) => 0
    case (2, _) => 0
    case(i, j) => List(1, i-2).max * List(1, j-2).max
  }
  println(result)
}
