N = int(input())
A = list(map(int, input().split()))
money = [[1000, 0]]
ans = 1000
B = [1 for _ in range(N)] #-1 -> buy 1 ->sell 0 -> nothing
for k in range(N-1):
  if A[k] < A[k+1]:
    B[k] = -1
  elif A[k] == A[k+1]:
    B[k] = 0

for k in range(N):
  if B[k] == -1:
    new = [money[0]]
    for j in range(len(money)):
      if A[k] <= money[j][0]:
        new.append([money[j][0]%A[k], money[j][1] + money[j][0]//A[k]])
    money = new
  
  if B[k] == 1:
    new = []
    ans = 0
    for j in range(len(money)):
      ans = max(money[j][0] + money[j][1]*A[k], ans)
    money[0] = [ans, 0]

print(ans)