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

A = [1000]+A+[0]
Y = 1000
kabu = 0
ans = 1000

for a,b,c in zip(A,A[1:],A[2:]):
    if a>=b and b<c:
        kabu = Y//b
        Y -= b*kabu
    if a<=b and b>c:
        Y += b*kabu
        kabu = 0
        ans = max(ans,Y)

print(ans)