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

buy = 0
money = 1000
for i in range(N-1):
    if A[i] < A[i+1]:
        buy = money // A[i]
        money = money % A[i]
    elif A[i] > A[i+1]:
        money += buy*A[i]
        buy = 0

if buy != 0:
    money += buy*A[-1]

print(money)