import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); final int N = sc.nextInt(); int[] array = new int[N]; for(int i = 0; i < N; i++){ array[i] = sc.nextInt(); } int[] DP = new int[1 << N]; DP[0] = 100; for(int bit = 0; bit < (1 << N); bit++){ if(DP[bit] == 0){ continue; } int level = 1; for(int i = 0; i < N; i++){ if((bit & (1 << i)) != 0 && (array[i] < 0)){ level++; } } for(int i = 0; i < N; i++){ if((bit & (1 << i)) == 0){ DP[bit | (1 << i)] = Math.max(DP[bit | (1 << i)], Math.max(0, Math.min(level * 100, DP[bit] + array[i]))); } } } System.out.println(DP[(1 << N) - 1]); } }