N = int(input())
A = list(map(int,input().split()))
M = 1000
S = 0
for i in range(N-1):
  if A[i]<A[i+1]:
    S += M//A[i]
    M -= S*A[i]
  elif A[i]>A[i+1]:
    M += S*A[i]
    S = 0
M+=A[-1]*S
print(M)