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

money = 1000
stock = 0
for i in range(N - 1):
    if A[i] == A[i + 1]:
        continue
    elif A[i] > A[i + 1]:
        while stock > 0:
            money += A[i]
            stock -= 1
    elif A[i] < A[i + 1]:
        while money >= A[i]:
            money -= A[i]
            stock += 1
while stock > 0:
    money += A[N - 1]
    stock -= 1

print(money)