main = do
 getLine
 cs <- map read . words <$> getLine
 let th = div (sum cs) 10
 print $ (*30) $ length $ filter (<=th) cs