package b20160710; import java.util.Scanner; public class No_191 { public static void main(String[] args) { double sum = 0; Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int[] MiT = new int[N]; for(int i = 0; i < N; i++){ MiT[i] = sc.nextInt(); sum+= MiT[i]; } sc.close(); int CMiT = 0; for(int i = 0; i < N; i++){ if(MiT[i] * 10 <= sum){ CMiT += 30; } } System.out.println(CMiT); } }