N = int(input())
lst = list(map(int, input().split()))
bs = [0]*N
stock = 0
money = 1000

for i in range(1, N):
    if lst[i-1] < lst[i]:
        bs[i-1] = 1
        if i > 1 and bs[i-2] == 1:
            bs[i-1] = -1

for i in range(N):
    if bs[i] == 1:
        stock = money // lst[i]
        money = money % lst[i]
    elif bs[i] == 0 and stock > 0:
        money += stock * lst[i]
        stock = 0
    elif bs[i] == -1 and i == N-1 and stock > 0:
        money += stock * lst[i]
        stock = 0

print(money)
