N = int(input())
list_A = list(map(int, input().split()))
money = 1000
stock = 0

for i in range(N - 1):
    if list_A[i] < list_A[i + 1]:
        stock = money // list_A[i]
        money -= stock * list_A[i]
    elif list_A[i] > list_A[i + 1]:
        money += stock * list_A[i]
        stock = 0

last_stock_val = 0
for i in range(N -1):
    if list_A[-1-i] < list_A[-2-i]:
        continue
    else:
        last_stock_val = list_A[-1-i]
        break
money += stock * last_stock_val
print(money)