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

C = 1000
S = 0

for i in range(N-1):
    if A[i] < A[i+1]:
        S = C // A[i]
        C = C % A[i]
    elif A[i] > A[i+1]:
        C += A[i]*S
        S = 0

if S > 0:
    C += S*A[-1]

print(C)
