#!/usr/bin/env python3

import sys

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

read = sys.stdin.buffer.read

sys.setrecursionlimit(10 ** 7)

INF = float('inf')



N = int(eval(input()))

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



# どこで反転するかを記録する

pre = [0] * N

pre_index = 0

old_a = A[0]

if A[0] > A[1]:

    old_coef = -1

elif A[0] < A[1]:

    old_coef = 1

else:

    old_coef = 0



for i in range(1, N):

    if A[i] > old_a:

        coef = 1

    elif A[i] < old_a:

        coef = -1

    else:

        coef = 0

    if coef != 0 and coef != old_coef:

        for j in range(pre_index, i):

            pre[j] = i - 1

        pre_index = i

        old_coef = coef

    old_a = A[i]

for j in range(pre_index, N):

    pre[j] = N - 1

# print("pre: {}".format(pre))



shojikin = 1000

stock = 0

if A[0] < A[pre[0]]:

    q, mod = divmod(shojikin, A[0])

    stock += q

    shojikin = mod

elif pre[0] == N - 1:

    # 何もしないほうが良い場合

    print('1000')

    quit()



# print("1st shojikin: {} stock: {}".format(shojikin, stock))



pre = list(set(pre))

pre.sort()

# print("sorted: {}".format(pre))

for deal_index in pre:

    if stock:

        shojikin += stock * A[deal_index]

        stock = 0

        # print("uri deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock))

    else:

        q, mod = divmod(shojikin, A[deal_index])

        stock += q

        shojikin = mod

        # print("kai deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock))

# 下がり続けた場合は払い戻し

if stock:

    shojikin += stock * A[deal_index]

    stock = 0

print(shojikin)
#!/usr/bin/env python3

import sys

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

read = sys.stdin.buffer.read

sys.setrecursionlimit(10 ** 7)

INF = float('inf')



N = int(eval(input()))

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



shojikin = 1000

stock = 0

for i in range(N):

    if stock:

        shojikin += stock * A[i]

        stock = 0

    if i+1 < N:

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

            q, mod = divmod(shojikin, A[i])

            stock = q

            shojikin = mod



print(shojikin)

#!/usr/bin/env python3
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10**7)
INF = float("inf")
N = int(eval(input()))
A = list(map(int, input().split()))
# どこで反転するかを記録する
pre = [0] * N
pre_index = 0
old_a = A[0]
if A[0] > A[1]:
    old_coef = -1
elif A[0] < A[1]:
    old_coef = 1
else:
    old_coef = 0
for i in range(1, N):
    if A[i] > old_a:
        coef = 1
    elif A[i] < old_a:
        coef = -1
    else:
        coef = 0
    if coef != 0 and coef != old_coef:
        for j in range(pre_index, i):
            pre[j] = i - 1
        pre_index = i
        old_coef = coef
    old_a = A[i]
for j in range(pre_index, N):
    pre[j] = N - 1
# print("pre: {}".format(pre))
shojikin = 1000
stock = 0
if A[0] < A[pre[0]]:
    q, mod = divmod(shojikin, A[0])
    stock += q
    shojikin = mod
elif pre[0] == N - 1:
    # 何もしないほうが良い場合
    print("1000")
    quit()
# print("1st shojikin: {} stock: {}".format(shojikin, stock))
pre = list(set(pre))
pre.sort()
# print("sorted: {}".format(pre))
for deal_index in pre:
    if stock:
        shojikin += stock * A[deal_index]
        stock = 0
        # print("uri deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock))
    else:
        q, mod = divmod(shojikin, A[deal_index])
        stock += q
        shojikin = mod
        # print("kai deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock))
# 下がり続けた場合は払い戻し
if stock:
    shojikin += stock * A[deal_index]
    stock = 0
print(shojikin)

#!/usr/bin/env python3
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10**7)
INF = float("inf")
N = int(eval(input()))
A = list(map(int, input().split()))
shojikin = 1000
stock = 0
for i in range(N):
    if stock:
        shojikin += stock * A[i]
        stock = 0
    if i + 1 < N:
        if A[i] < A[i + 1]:
            q, mod = divmod(shojikin, A[i])
            stock = q
            shojikin = mod
print(shojikin)

-# どこで反転するかを記録する -pre = [0] * N -pre_index = 0 -old_a = A[0] -if A[0] > A[1]: -    old_coef = -1 -elif A[0] < A[1]: -    old_coef = 1 -else: -    old_coef = 0 -for i in range(1, N): -    if A[i] > old_a: -        coef = 1 -    elif A[i] < old_a: -        coef = -1 -    else: -        coef = 0 -    if coef != 0 and coef != old_coef: -        for j in range(pre_index, i): -            pre[j] = i - 1 -        pre_index = i -        old_coef = coef -    old_a = A[i] -for j in range(pre_index, N): -    pre[j] = N - 1 -# print("pre: {}".format(pre)) -if A[0] < A[pre[0]]: -    q, mod = divmod(shojikin, A[0]) -    stock += q -    shojikin = mod -elif pre[0] == N - 1: -    # 何もしないほうが良い場合 -    print("1000") -    quit() -# print("1st shojikin: {} stock: {}".format(shojikin, stock)) -pre = list(set(pre)) -pre.sort() -# print("sorted: {}".format(pre)) -for deal_index in pre: +for i in range(N): -        shojikin += stock * A[deal_index] +        shojikin += stock * A[i] -        # print("uri deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock)) -    else: -        q, mod = divmod(shojikin, A[deal_index]) -        stock += q -        shojikin = mod -        # print("kai deal: {} shojikin: {} stock: {}".format(deal_index, shojikin, stock)) -# 下がり続けた場合は払い戻し -if stock: -    shojikin += stock * A[deal_index] -    stock = 0 +    if i + 1 < N: +        if A[i] < A[i + 1]: +            q, mod = divmod(shojikin, A[i]) +            stock = q +            shojikin = mod