import java.io.*; import java.util.*; import java.math.*; class Main191 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String[] str = new String[n]; str = br.readLine().split(" "); int[] nums = new int[n]; int sum = 0, ans = 0; for (int i = 0; i < n; i++) { nums[i] = Integer.parseInt(str[i]); sum += nums[i]; } for (int m : nums) { if (m <= (double)sum / 10.0) ans += 30; } System.out.println(ans); } }