import java.util.Scanner; public class Main_yukicoder191 { 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 ret = 0; int lim = sum / 10; for (int i = 0; i < n; i++) { if (c[i] <= lim) { ret += 30; } } System.out.println(ret); sc.close(); } }