def judgeFinalSellDay(x):
  max = 0
  ret=0
  for i in range(n-1,-1,-1):
    if x[i] > max:
      max =x[i]
      ret=i
    elif x[i] < max:
      break
  return ret

n=int(input())
a=list(map(int,input().split()))

final=judgeFinalSellDay(a)
money=1000
kabu=0
for i in range(n):
  if i == final:
    money+=kabu*a[i]
    kabu=0
    break
  else:
    if a[i+1] > a[i]:
      kabu=int(money/a[i])
      money=money%a[i]
    elif a[i+1] < a[i]:
      money+=kabu*a[i]
      kabu=0
print(money)