using System; using System.Linq; class Program { static void Main() { int n = int.Parse(Console.ReadLine()); double[] c = Console.ReadLine().Split().Select(double.Parse).ToArray(); int ans = 0; for (int i = 0; i < n; i++) { if (c[i] <= c.Sum() / 10) ans += 30; } Console.WriteLine(ans); } }