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

money = 1000
temp = A[0]
up = None

for i in range(N-1):
  if A[i] == A[i+1]:
    continue

  if up is None:
    if temp < A[i+1]:
      up = True
    elif temp < A[i+1]:
      up = False
    continue

  if up:
    if A[i] < A[i+1]:
      continue
    else:
      up = False
      d = money // temp
      money += d * (A[i] - temp)
      temp = A[i+1]
  else:
    if A[i] < A[i+1]:
      up = True
    else:
      temp = A[i+1]

if up:
  d = money // temp
  money += d * (A[-1] - temp)

print(money)
