import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int []C = new int[N]; for(int i = 0; i < N; i++) { C[i] = scan.nextInt(); } scan.close(); int sum = 0; for(int i = 0; i < N; i++) { sum += C[i]; } double k = sum / 10; int cnt = 0; for(int i = 0; i < N; i++) { if(k >= C[i]) { cnt ++; } } System.out.println(cnt * 30); } }