import java.io.*; import java.util.Arrays; class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=""; while((line=br.readLine())!=null){ int n=Integer.parseInt(line); int[] w=new int[n]; int total=0; String[] values=br.readLine().split(" "); for(int i=0;i