def resolve():
    import numpy as np
    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)

    l = 0
    flag = 1
    for i in range(1, n):
        if A[i - 1] <= A[i] and flag:
            l = i - 1
            flag = 0
        elif flag == 0:
            k = C // A[l]
            C -= k * A[l]
            kabu += k

            C += kabu * A[i - 1]
            kabu = 0
            flag = 1

        # 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(l, kabu, C)
    if A[l] < A[-1]:
        k = C // A[l]
        C -= k * A[l]
        kabu += k
        C += kabu * A[-1]
    print(C)

resolve()
