INF=10**30
N=int(input())
A=list(map(int,input().split()))
dp=[[-INF for i in range(16001)] for i in range(N+1)]
dp[0][0]=1000#dp[i][j]=i日目に株をj個持っているときの最大所持金

for i in range(N):
    for j in range(16001):
        if dp[i][j]==-INF:
            continue
        for x in range(j+1):#買う
            if j-x>=0:
                dp[i+1][j-x]=max(dp[i][j]+A[i]*x,dp[i+1][j-x])
            else:
                break
        for x in range(dp[i][j]//A[i]+1):#売る
            if dp[i][j]-A[i]*x>=0:
                dp[i+1][j+x]=max(dp[i][j]-A[i]*x,dp[i+1][j+x])
            else:
                break
print(max(dp[N]))