N = int(input())
A = list(map(int,input().split()))

money = 1000
stock = 0

for i in range(N-1):
    if A[i+1] > a[i]:
        if money >= A[i]:
            n = money // A[i]
            stock += n
            money -= A[i] * n
    elif A[i+1] == A[i]:
        continue
    else:
        if stock > 1:
            money += stock * A[i]
            stock = 0

if stock > 0:
    money += stock * A[-1]

print(money)