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

wallet = 1000
stock = 0

for i in range(len(a)-1):
  if a[i+1] > a[i]:
    stock = wallet // a[i]
    wallet -= stock * a[i]
  elif a[i+1] < a[i]:
    wallet += stock * a[i]
    stock = 0

wallet += stock * a[-1]

print(wallet)