k = int(input())
a = list(map(int,input().split()))
a.append(1)
a.append(0)

money = 1000
stock = 0

for i in range(k):
    if a[i] < a[i+1]:
        stock += money//a[i]
        money -= a[i] * stock
        continue
    if a[i] > a[i+1] and a[i] > a[i+2]:
        money += a[i] * stock
        stock = 0
        continue
    else:
        continue
print(money)