main = do
	getLine
	p <- getLine >>= return . map read . words
	let s = sum p
	print $ (*30) $ length $ filter (<= s `div` 10) p