package yukicoder; import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { BufferedReader read = new BufferedReader(new InputStreamReader(System.in)); try { int N = Integer.parseInt(read.readLine()); String[] box = read.readLine().split(" "); int[] v = new int[N]; int total = 0; for (int i = 0; i < N; ++i) { v[i] = Integer.parseInt(box[i]); total += v[i]; } int border = total / 10; int count = 0; for (int i = 0; i < N; ++i) { if (v[i] <= border) { ++count; } } System.out.println(count * 30); } catch (Exception e) { e.printStackTrace(); } } }