import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int[] voteobNum = new int[N]; int voteTotal = 0; for(int i = 0; i < N; i++){ voteobNum[i] = scan.nextInt(); voteTotal += voteobNum[i]; } int evaluationCriteria = voteTotal / 10; int depositTotal = 0; for(int i = 0; i < N; i++){ if(voteobNum[i] <= evaluationCriteria) depositTotal += 30; } System.out.println(depositTotal); scan.close(); } }