N = int(input())
A = list(map(int, input().split()))
money = 1000
kabu = 0

if A[0] <= A[1]:
    kabu += money // A[0]
    money = money % A[0]

for i in range(1, N-1):
  if A[i-1] > A[i] and A[i] <= A[i+1]:
    kabu += money // A[i]
    money = money % A[i]
  elif A[i-1] < A[i] and A[i] >= A[i+1]:
    money += kabu * A[i]
    kabu = 0
  else:
    continue

money += kabu * A[N-1]
kabu = 0
print(money)