n = int(input())
a = list(map(int, input().split()))
cash = 1000
kabu = 0
up=False
down=False
sell = []*n
buy = []*n
first=True
for i,j in zip(a[:-1], a[1:]):
  if first:
    first=False
    if i < j:
      up = True
      buy.append(i)
      continue
    elif i > j:
      down=True
  if i < j:
    if down:
      buy.append(i)
    up = True
  elif i > j:
    if up:
      # sell
      sell.append(i)
    down=True
else:
  if up:
    sell.append(a[-1])

for i,j in zip(buy,sell):
  kabu = cash // i
  cash -= kabu * i
  cash += j*kabu
print(cash)