def d():
    N = int(input())
    A = list(map(int, input().split()))

    money = 1000
    stock = 0

    for i in range(1, N):
        print(A[i-1])
        if A[i-1] < A[i]:
            stock += money // A[i-1]
            money -= A[i-1] * (money // A[i-1])
            # print('buy  - stock: {}, money: {}'.format(stock, money))

        elif A[i-1] > A[i]:
            money += stock * A[i-1]
            stock = 0
            # print('sell - stock: {}, money: {}'.format(stock, money))

    if A[N-2] < A[N-1]:
        money += stock * A[N-1]
        stock = 0
        # print('sell - stock: {}, money: {}'.format(stock, money))

    print(money)


##########
if __name__ == "__main__":
    d()
