N = int(input())
A = list(map(int, input().split()))

start = [[0, 1000], [0, 1000]]
#0: all stack, 1: all money
max_index = [i for i, v in enumerate(A) if v == max(A)][-1]
#print(max_index)

ans = 0
for i in range(N):
  if i == max_index:
    ans = start[0][0] * A[i] + start[0][1]
  else:
    money = max([
      start[0][0] * A[i] + start[0][1],  start[1][0] * A[i] + start[1][1]
    ])
    start = [[money//A[i], money - (money//A[i])*A[i] ],  [0, money]]
print(max([start[0][0] * A[i] + start[0][1],  start[1][0] * A[i] + start[1][1]]))