def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    stocks = 0
    money = 1000
    i = 0
    while i < N:
        buy = i
        sell = i
        while sell < N-1 and A[sell] <= A[sell+1]:
            sell += 1
        if buy == sell:
            print(money)
            return
        
        stocks = money//A[buy]
        money = money - stocks*A[buy]
        money += stocks*A[sell]
        stocks = 0
        i = sell+1
    print(money)


if '__main__' == __name__:
    resolve()