N = int(input())
A = list(map(int, input().split()))
stock = 0
money = 1000

for i in range(N-1):
    if A[i] < A[i+1]:
        s, money =  divmod(money, A[i])
        stock += s
    elif A[i] == A[i+1]:
        money += stock * A[i]
        stock = 0
    else:
        continue
if stock > 0:
    money += stock * A[N-1]
print(money)