cash = 1000
stock = 0
N = int(input())
l = list(map(int, input().split()))

downTrend = True

prev = l[0]
for i in range(1, N):
    A = l[i]
    if downTrend == True:
        if A < prev:
            prev = A
        else:
            stock, cash = divmod(cash, prev)
            prev = A
            downTrend = False
    else:
        if A > prev:
            prev = A
        else:
            cash += stock * prev
            stock = 0
            downTrend = True
cash += stock * prev

print(cash)
