main = do
  (a:b:xs) <- map read . words <$> getLine
  putStrLn . show $ solve a b

solve :: Int -> Int -> Int
solve a b 
  | a > 1 && b > 1 = (a-2) * (b-2)
  | a == 1 && b == 1 = 1
  | a == 1 && b /= 1 = b-2
  | otherwise = a-2