import Control.Applicative

main :: IO ()
main = do
  ns <- (map read . words) <$> getLine :: IO [Int]
  putStrLn $ show $ solve ns

solve :: [Int] -> Int
solve (n:m:_)
  | n == 1 && m == 1 = 1
  | n == 1           = m - 2
  | m == 1           = n - 2
  | otherwise        = (n -2) * (m - 2)
