def maxLife(D,_st): st=_st c=0 i=0 while True: if st%2==1 and D[i]<0: c+=1 i+=1 st=(st-st%2)/2 if st==0: break return (c+1)*100 def calcLife(D,dp,_st): st=_st i=0 tmpMax=0 limitLife=maxLife(D,_st) while True: if st%2==1 and dp[_st-2**i]>0: life=min(dp[_st-2**i]+D[i],limitLife) tmpMax=max(tmpMax,life) i+=1 st=(st-st%2)/2 if st==0: break return tmpMax N=int(raw_input()) D=map(int,raw_input().split()) # dp[i] : max life for beat status(i) monsters dp=[0]*(2**N) dp[0]=100 for i in xrange(1,2**N): dp[i]=calcLife(D,dp,i) print dp[2**N-1]