# coding: utf-8





def solve(*args: str) -> str:

    n = int(args[0])

    A = list(map(int, args[1].split()))

    budget = 1000

    stock = 0

    temp = 0



    for i in range(n-1):

        if A[i] < A[i+1] and A[i] <= temp+budget:

            budget += temp

            temp = 0

            stock = budget//A[i]

            budget %= A[i]

        elif A[i+1] < A[i]:

            budget += A[i]*stock

            stock = 0



    return str(A[-1]*stock+budget)





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8





def solve(*args: str) -> str:

    n = int(args[0])

    A = list(map(int, args[1].split()))

    budget = 1000

    stock = 0



    for i in range(n-1):

        if A[i] < A[i+1] and A[i] <= budget:

            stock, budget = divmod(budget, A[i])

        elif A[i+1] < A[i]:

            budget += A[i]*stock

            stock = 0



    return str(A[-1]*stock+budget)





if __name__ == "__main__":

    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))
    budget = 1000
    stock = 0
    temp = 0
    for i in range(n - 1):
        if A[i] < A[i + 1] and A[i] <= temp + budget:
            budget += temp
            temp = 0
            stock = budget // A[i]
            budget %= A[i]
        elif A[i + 1] < A[i]:
            budget += A[i] * stock
            stock = 0
    return str(A[-1] * stock + budget)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

# coding: utf-8
def solve(*args: str) -> str:
    n = int(args[0])
    A = list(map(int, args[1].split()))
    budget = 1000
    stock = 0
    for i in range(n - 1):
        if A[i] < A[i + 1] and A[i] <= budget:
            stock, budget = divmod(budget, A[i])
        elif A[i + 1] < A[i]:
            budget += A[i] * stock
            stock = 0
    return str(A[-1] * stock + budget)


if __name__ == "__main__":
    print((solve(*(open(0).read().splitlines()))))

-    temp = 0 -        if A[i] < A[i + 1] and A[i] <= temp + budget: -            budget += temp -            temp = 0 -            stock = budget // A[i] -            budget %= A[i] +        if A[i] < A[i + 1] and A[i] <= budget: +            stock, budget = divmod(budget, A[i])