import java.util.Scanner; public class yukicoder_191 { public static void main(String[] args) { Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int[] c = new int[n]; int sosu = 0; for (int i = 0; i < n; i++) { c[i] = stdIn.nextInt(); sosu += c[i]; } int yuko = sosu / 10; int ninzu = 0; for (int i = 0; i < n; i++) { if (c[i] <= yuko) { ninzu++; } } System.out.println(ninzu * 30); } }