import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.stream.Stream; public class No00000191_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int[] intArr = Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); int line = Arrays.stream(intArr).sum() / 10; int cnt = 0; for(int i = 0; i < n; i++) { if(line >= intArr[i] ) { cnt++; } } System.out.println(cnt * 30); } }