import qualified Data.ByteString.Char8 as BS main = do _ <- getLine cs <- map (read . BS.unpack) . BS.words <$> BS.getLine putStr . show . (*) 30 . length $ filter (<= ((sum cs) `div` 10)) cs