import sys #sys.setrecursionlimit(n) import heapq import re import bisect import random import math import itertools from collections import defaultdict, deque from copy import deepcopy from decimal import * n = int(input()) d = list(map(int, input().split())) l = defaultdict(int) l[0] = 100 for i in range(1, 1 << n): for j in range(n): if i & 1 << j: if d[j] < 0: l[i] = l[i - (1 << j)] + 100 else: l[i] = l[i - (1 << j)] # print(l[i]) break dp = defaultdict(int) dp[0] = 100 for i in range(1 << n): if dp[i] == 0: continue for j in range(n): if i & (1 << j) == 0: # print('{:b}'.format(i + (1 << j)), i, j, dp[i], d[j]) # print('{:b}'.format(i)) # print('{:b}'.format(1 << j)) dp[i + (1 << j)] = max(dp[i + (1 << j)], min(dp[i] + d[j], l[i + (1 << j)])) print(dp[(1 << n) - 1])