n, *a = map(int, open(0).read().split())
max_a = max(a)
money = 1000
stock = 0
if a[0] != max_a:
    stock += money // a[0]
    money = money % a[0]
    for i in range(1, n):
        if a[i] < a[i-1]:
            stock += money // a[i]
            money = money % a[i]
        elif a[i] > a[i-1]:
            money += stock * a[i]
            stock = 0
print(money)