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