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

# dp = [[0, 0] for i in range(N+1)]
# #dp[i][0] i日目の所持金 i[1] i日目の株個数
# dp[0][0] = 1000
# dp[0][1] = 0
money = 1000
stock = 0
for i in range(N):
    if i==N-1:
        money += stock * A[i]
        break
    if A[i] < A[i+1]:
        stock = money//A[i]
        money -= A[i] * stock
    elif A[i] > A[i+1]:
        money += stock * A[i]
        stock = 0
print(money)
