N = int(input())
A = [*map(int, input().split())]

Y = 1000
buy, sell = [], []
for i in range(N):
  if not buy:
    buy.append(A[i])
  elif A[i] <= buy[-1]:
    buy[-1] = A[i]
  elif not sell:
    sell.append(A[i])
  elif A[i] >= sell[-1]:
    sell[-1] = A[i]
  else:
    div, mod = divmod(Y, buy.pop())
    Y = sell.pop() * div + mod
    buy.append(A[i])
if buy and sell and buy[-1] < sell[-1]:
    div, mod = divmod(Y, buy.pop())
    Y = sell.pop() * div + mod
print(Y)