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

money = 1000
stock = 0

stock += 1000//A[0]
money -= stock*A[0]

now = A[0]
for i in range(1,n):
    if i == n-1:
        money += A[i]*stock
        break
    if A[i] >= now:#上がったら、nowは買いのタイミングだった
        if stock == 0:
            stock += money//now
            money -= now*stock
        now = A[i]
    else:#下がったら、nowは売りのタイミングだった
        money += now*stock
        stock = 0
        now = A[i]
        
print(max(1000, money))