N = int(input())
A = list(map(int,input().split()))

ud = [0] * (N-1)
for i in range(1,N):
    if A[i] > A[i-1]:
        ud[i-1] = 1
    if A[i] < A[i-1] :
        ud[i-1] = -1
    else:
        continue
        
tmp =0
bs = [''] * N
if ud[0] == 1:
    bs[0] = 'b'
    tmp = 1
if ud[0] == -1:
    tmp = -1

for i in range(1,len(ud)):
    if tmp == 0 and ud[i] != 0:
        tmp = ud[i]
    elif ud[i] == 0:
        continue
    elif tmp == -1 and ud[i] == 1:
        bs[i] = 'b'
        tmp = ud[i]
    elif tmp == 1 and ud[i] == -1:
        bs[i] = 's'
        tmp = ud[i]
bs[-1] = 's'

kabu = 0
zan = 1000
for i in range(N):
    if bs[i] == 'b':
        kabu = zan // A[i]
        zan -= kabu * A[i]
    if bs[i] == 's':
        zan += kabu * A[i]
        kabu = 0
print(zan)