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