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

K = 0
m = 1000

for i in range(N):
    if i == N-1:
        m += K*A[i]
        break
    for k in range(N-i):
        if A[i] < A[i+k+1]:
            if K > 0:
                m += K*A[i]
            K = m//A[i]
            m = m%A[i]
            break
        else:
            if A[i] > A[i+k+1]:
                m += K*A[i]
                K = 0
                break
            else:
                continue
print(m)
