def main():

    n = int(eval(input()))

    A = list(map(int, input().split()))

    ans = 1000

    t, p = [], []

    if A[0] < A[1]:

        t.append(0)

    for i in range(1, n - 1):

        if A[i - 1] >= A[i] < A[i + 1]:

            t.append(i)

        elif A[i - 1] <= A[i] > A[i + 1]:

            p.append(i)

    b = 0

    for i in range(n):

        if i in t:

            b += ans // A[i]

            ans %= A[i]

        if i in p:

            ans += b * A[i]

            b = 0

    if b > 0:

        ans += b * A[-1]

    print(ans)





if __name__ == '__main__':

    main()

def main():

    n = int(eval(input()))

    A = list(map(int, input().split()))

    ans, b = 1000, 0

    def buy(a):

        nonlocal b, ans

        b += ans // a

        ans %= a

    def sell(a):

        nonlocal b, ans

        ans += b * a

        b = 0

    if A[0] < A[1]: buy(A[0])

    for i in range(1, n - 1):

        if A[i - 1] >= A[i] < A[i + 1]:

            buy(A[i])

        elif A[i - 1] <= A[i] > A[i + 1]:

            sell(A[i])

        else:

            continue

    if b > 0:

        sell(A[-1])

    print(ans)



if __name__ == '__main__':

    main()

def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    ans = 1000
    t, p = [], []
    if A[0] < A[1]:
        t.append(0)
    for i in range(1, n - 1):
        if A[i - 1] >= A[i] < A[i + 1]:
            t.append(i)
        elif A[i - 1] <= A[i] > A[i + 1]:
            p.append(i)
    b = 0
    for i in range(n):
        if i in t:
            b += ans // A[i]
            ans %= A[i]
        if i in p:
            ans += b * A[i]
            b = 0
    if b > 0:
        ans += b * A[-1]
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    A = list(map(int, input().split()))
    ans, b = 1000, 0

    def buy(a):
        nonlocal b, ans
        b += ans // a
        ans %= a

    def sell(a):
        nonlocal b, ans
        ans += b * a
        b = 0

    if A[0] < A[1]:
        buy(A[0])
    for i in range(1, n - 1):
        if A[i - 1] >= A[i] < A[i + 1]:
            buy(A[i])
        elif A[i - 1] <= A[i] > A[i + 1]:
            sell(A[i])
        else:
            continue
    if b > 0:
        sell(A[-1])
    print(ans)


if __name__ == "__main__":
    main()

-    ans = 1000 -    t, p = [], [] +    ans, b = 1000, 0 + +    def buy(a): +        nonlocal b, ans +        b += ans // a +        ans %= a + +    def sell(a): +        nonlocal b, ans +        ans += b * a +        b = 0 + -        t.append(0) +        buy(A[0]) -            t.append(i) +            buy(A[i]) -            p.append(i) -    b = 0 -    for i in range(n): -        if i in t: -            b += ans // A[i] -            ans %= A[i] -        if i in p: -            ans += b * A[i] -            b = 0 +            sell(A[i]) +        else: +            continue -        ans += b * A[-1] +        sell(A[-1])