import scala.io._
object Main {
	def main(args: Array[String]) {
		val input = Source.fromInputStream(System.in)
		val lines = input.getLines.toSeq

		var size = lines(0).split(" ").map(_.toInt)
		var res = 0
		
		res = (size(0) - 2) * (size(1) - 2)
		if (res < 0) res *= -1
		println(res)
	}
}
