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

p = 1000
n = 0
for i in range(N-1):
    if A[i+1] > A[i]:
        n = p//A[i]
        p = p % A[i]
    if A[i+1] < A[i]:
        p += n*A[i]
        n = 0

p += n*A[-1]
print(p)
