N = int(input())
A = list(map(int,input().split()))
# print('A:',A)

from itertools import product
a=[0,1]  #0:buy  1:sell
Ls = list(product(a, repeat=N))
# print('Ls:',Ls)
out=0
for L in Ls:
    # print('L:',L)
    money=1000
    kabu=0
    for i in range(N):
        if L[i]==0:
            kabu+=money // A[i]
            money=money % A[i]

        else:
            money+=kabu*A[i]
            kabu=0
        # print('money,kabu:',money,kabu)
    out=max(out,money)

print(out)
