import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] d = new int[n]; for(int i = 0; i < n; i++) { d[i] = sc.nextInt(); } int p = (int)Math.pow(2, n); int[] kosuu = new int[p]; int[] dp = new int[p]; for(int i = 1; i < p; i++) { for(int j = 0; j < n; j++) { if(((i & (1 << j)) != 0) && (d[j] < 0)) kosuu[i]++; } } for(int i = 0; i < p; i++) { dp[i] = -1; } dp[0] = 100; for(int i = 1; i < p; i++) { for(int j = 0; j < n; j++) { if((i & (1 << j)) != 0) { int i1 = i - (1 << j); if(dp[i1] >= 0) { int t = dp[i1]; int max = 100 + kosuu[i1] * 100; if(d[j] > 0) { t = Math.min(t + d[j], max); } else { if((t + d[j]) >= 0) { t += d[j]; } else { t = -1; } } dp[i] = Math.max(dp[i], t); } } } } int ans = dp[p - 1]; if(dp[p - 1] == -1) ans = 0; System.out.println(ans); } }