f :: Integer -> Integer -> Integer
f 1 1 = 1
f 1 m = (m-2)
f n 1 = (n-2)
f n m =(n-2)*(m-2)

main = do
       x<-getLine
       let (a:b:[])=map read (words x)::[Integer]
       putStrLn $ show $ f a b