N=int(input())
A=list(map(int,input().split()))
tmp=A[0]
ans=1000
kabu=0
for i in range(1,N):
    if tmp < A[i]:
        kabu=ans//tmp
        ans=ans%tmp
        tmp=A[i]
    elif tmp > A[i]:
        ans+=kabu*tmp
        kabu=0
        tmp=A[i]
if kabu > 0:
    ans+=kabu*A[-1]
print(ans)