n = int(input())
a = list(map(int, input().split()))
prev = a[0]
up = False
staks = 0
money = 1000
for i in a[1:]:
    if i > prev and not up:
        staks = money//prev
        money = money % prev
        up = not up
    if i < prev and up:
        money += prev*staks
        stacks = 0
        up = not up
    prev = i
if staks:
    money += prev*staks

print(money)
