package m.shin; import java.util.Scanner; public class Con191 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int N = s.nextInt() , total = 0 , money = 0;; int[] C = new int[N]; for(int i = 0;i < N;i++){ C[i] = s.nextInt(); total += C[i]; } s.close(); total /= 10; for(int i = 0;i < N;i++){ if(C[i] <= total){ money += 30; } } System.out.println(money); } }