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

budget = 1000
stock = 0
for i in range(n-1):
    if l[i] < l[i+1]:
        stock = budget // l[i]
        budget = budget % l[i]
    elif l[i] > l[i+1]:
        budget = budget + stock * l[i]
        stock = 0
else:
    budget += stock*l[-1]
    stock = 0

print(budget)
