import Data.List

f [] = [[]]
f (x:xs) = concat $ [map (:ys) [x-1,x,x+1]| ys <- f xs]

main = do
	n <- readLn :: IO Int
	as <- map read . words <$> getLine :: IO [Int]

	print $ length $ filter even $ map product (f as)