import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; public class Main { public static void main(String args[]) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); int n = Integer.parseInt(line); line = br.readLine(); String[] lines = line.split(" "); int[] cs = new int[n]; int total = 0; int i = 0; for (; i < n; i++) { cs[i] = Integer.parseInt(lines[i]); total += cs[i]; } int border = total / 10; int res = 0; for (int t : cs) { if (t <= border) { res++; } } System.out.println(res * 30); } }