import java.util.*; public class Exercise92{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] c = new int[n]; int sum = 0; for(int i = 0; i < n; i++){ c[i] = sc.nextInt(); sum += c[i]; } int count = 0; for(int i = 0; i < n; i++){ if(c[i] <= sum / 10){ count++; } } System.out.println(30 * count); } }