N = int(input())
A = list(map(int,input().split()))
my_money = 1000
stock = 0

ls = []
if A[0] < A[1]:
  ls.append(A[0])
for i in range(1,N-1):
  if A[i] == A[i-1]:
    continue
  elif A[i-1] < A[i] <= A[i+1]:
    continue
  elif A[i-1] > A[i] >= A[i+1]:
    continue
  ls.append(A[i])  
if A[-1] > A[-2]:
  ls.append(A[-1])
    
if ls == []:
  print(1000)
else:
  for i,j in enumerate(ls):
    if i%2 == 0:
      stock += my_money//j
      my_money %= j
    else:
      my_money += stock*j
      stock = 0
  print(my_money)