import collections

N=int(eval(input()))

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

i=0

A.insert(0,float("inf"))

#print(A)

buy=[0]*N

sell=[0]*N

for i in range(N-1):

    if (A[i]>=A[i+1])and(A[i+2]>=A[i+1]):

        buy[i]=1

    if (A[i]<=A[i+1])and(A[i+2]<=A[i+1]):

        sell[i]=1

kabu=0

money=1000

#print(buy,sell)

#print(money,kabu)

A=A[1:]

#print(A)

for i in range(N):

    if sell[i]==1:

        money=money+kabu*A[i]

        kabu=0

    if buy[i]==1:

        kabu=kabu+money//A[i]

        money=money-(money//A[i])*A[i]

    #print(money,kabu,A[i])

    #input()

#print(money,kabu)

money=money+kabu*A[N-1]

print(money)





import collections

N=int(eval(input()))

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

i=0

A.insert(0,float("inf"))

#print(A)

buy=[0]*N

sell=[0]*N

for i in range(N-1):

    if (A[i]>=A[i+1])and(A[i+2]>=A[i+1]):

        buy[i]=1

    if (A[i]<=A[i+1])and(A[i+2]<=A[i+1]):

        sell[i]=1

kabu=0

money=1000

#print(buy,sell)

#print(money,kabu)

A=A[1:]

#print(A)

for i in range(N):



    if buy[i]==1:

        kabu=kabu+money//A[i]

        money=money-(money//A[i])*A[i]



    if sell[i]==1:

        money=money+kabu*A[i]

        kabu=0



    #print(money,kabu,A[i])

    #input()

#print(money,kabu)

money=money+kabu*A[N-1]

print(money)



import collections

N = int(eval(input()))
A = list(map(int, input().split()))
i = 0
A.insert(0, float("inf"))
# print(A)
buy = [0] * N
sell = [0] * N
for i in range(N - 1):
    if (A[i] >= A[i + 1]) and (A[i + 2] >= A[i + 1]):
        buy[i] = 1
    if (A[i] <= A[i + 1]) and (A[i + 2] <= A[i + 1]):
        sell[i] = 1
kabu = 0
money = 1000
# print(buy,sell)
# print(money,kabu)
A = A[1:]
# print(A)
for i in range(N):
    if sell[i] == 1:
        money = money + kabu * A[i]
        kabu = 0
    if buy[i] == 1:
        kabu = kabu + money // A[i]
        money = money - (money // A[i]) * A[i]
    # print(money,kabu,A[i])
    # input()
# print(money,kabu)
money = money + kabu * A[N - 1]
print(money)

import collections

N = int(eval(input()))
A = list(map(int, input().split()))
i = 0
A.insert(0, float("inf"))
# print(A)
buy = [0] * N
sell = [0] * N
for i in range(N - 1):
    if (A[i] >= A[i + 1]) and (A[i + 2] >= A[i + 1]):
        buy[i] = 1
    if (A[i] <= A[i + 1]) and (A[i + 2] <= A[i + 1]):
        sell[i] = 1
kabu = 0
money = 1000
# print(buy,sell)
# print(money,kabu)
A = A[1:]
# print(A)
for i in range(N):
    if buy[i] == 1:
        kabu = kabu + money // A[i]
        money = money - (money // A[i]) * A[i]
    if sell[i] == 1:
        money = money + kabu * A[i]
        kabu = 0
    # print(money,kabu,A[i])
    # input()
# print(money,kabu)
money = money + kabu * A[N - 1]
print(money)

+    if buy[i] == 1: +        kabu = kabu + money // A[i] +        money = money - (money // A[i]) * A[i] -    if buy[i] == 1: -        kabu = kabu + money // A[i] -        money = money - (money // A[i]) * A[i]