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

money = 1000
stock = 0

for i in range(N):
    for j in range(i+1, N):
        if stock == 0:
            if A[i] < A[j]:
                stock += money // A[i]
                money -= stock * A[i]
                break
        else:
            if A[j-1] > A[j]:
                money += stock*A[j-1]
                stock = 0
                break

if stock > 0:
    money += stock * A[-1]
    stock = 0

print(money)



