n = int(input())
a = list(map(int, input().split()))

money = 1000
stack = 0
up = []
last_high = 0
high = 0
low = a[0]

for i in range(n):
    if i == 0:
        up.append(-1)
    elif a[i] > a[i - 1]:
        up.append(1)
    elif a[i] < a[i - 1]:
        up.append(-1)
    else:
        up.append(0)
print(up)

for i in range(n):
    if up[i] == 1:
        high = a[i]
        for j in range(last_high, i):
            if up[j] == -1:
                low = a[j]
        stack = money // low
        money %= low
        money += stack * high

print(money)
