import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); int[] arr = new int[N]; int sum = 0; for(int i = 0; i < N; i++){ arr[i] = sc.nextInt(); sum += arr[i]; } int count = 0; for(int i = 0; i < N; i++){ if(arr[i] * 10 <= sum){ count += 30; } } System.out.println(count); } }