using System; using System.Linq; class Program { static void Main(string[] args) { int N = int.Parse(Console.ReadLine()); int[] C = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); int henkanLine = C.Sum() / 10; Console.WriteLine(C.Where(x => x <= henkanLine).Count() * 30); } }