import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No191{ public static void main(String[] args) { try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); String[] temp = br.readLine().split(" "); int[] vote = new int[N]; for(int i=0; i < N; i++) vote[i] = Integer.parseInt(temp[i]); System.out.println(notReturnDeposit(N,vote)); } catch(IOException e){ e.getStackTrace(); } catch(NumberFormatException e){ e.getStackTrace(); } } public static int notReturnDeposit(int n, int[] a){ int voteTotal = 0; int notReturnMoney = 0; for(int i=0; i < n; i++) voteTotal += a[i]; for(int i=0; i < n; i++){ if(a[i] <= (voteTotal/10)) notReturnMoney += 30; } return notReturnMoney; } }