N=int(input())
A=list(map(int,input().split()))
mochi=1000
x=A[0]
y=0
k=0
kabu=0
for i in range(N):
    if A[i]>x:
        x=A[i]
        y=min(A[k:i])
        kabu=mochi//y
        mochi-=kabu*y
        mochi+=kabu*x
        k=i
print(mochi)