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

kabu=0
ans=1000

for i in range(N-1):
    if A[i] > A[i+1]:
        ans=ans+kabu*A[i]
        kabu=0

    if A[i] < A[i+1]:
        kabu=ans // A[i]
        ans=ans % A[i]

ans=ans+kabu*A[N-1]

print(ans)