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

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