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

money = 1000
stock = 0
buy_turn = True

for i, a in enumerate(A[:N]):
    if buy_turn:
        if A[i + 1] < A[i]:
            continue
        buy_turn = False
        stock += money // A[i]
        money = money % A[i]

    else:
        cnt = 0
        M = a
        for x in A[i + 1:]:
            if M <= x:
                cnt += 1
                M = x
            else:
                break

        if cnt == 1:
            continue
        else:
            buy_turn = True
            money += A[i] * stock
            stock = 0

print(money)
