def resolve():
    n = int(input())
    A = list(map(int, input().split()))
    C = 1000
    kabu = 0
    buy = []
    sell = []

    for i in range(n - 1, 0, -1):
        if A[i] > A[i - 1]:
            sell.append(i)
            if i == 1:
                buy.append(0)
        elif A[i] < A[i - 1] and len(sell) != 0:
            buy.append(i)

    for i in range(n):
        if i in buy:
            k = C // A[i]
            C -= k * A[i]
            kabu += k
        elif i in sell:
            C += kabu * A[i]
            kabu = 0

    print(C)

resolve()