N = int(input())
A = [0] + list(map(int, input().split()))

cng = [0]*(N+1)
for i in range(2, N+1):
    if A[i] > A[i-1]:
        cng[i] = 1
    elif A[i] < A[i-1]:
        cng[i] = -1

money = 1000
stock = 0

if 1 in cng:
    stock += money // A[1]
    money -= stock * A[1]

for i in range(2, N):
    # buy
    if cng[i+1] == 1:
        ds = money // A[i]
        dm = ds * A[i]
        stock += ds
        money -= dm
    # sell
    elif cng[i+1] == -1:
        ds = stock
        dm = ds * A[i]
        stock -= ds
        money += dm
        

if stock != 0:
    money += stock * A[N]

print(money)
