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

b = []

#1：購入、-1：売却、0：何もしない

for i in range(1, n):
  if a[i - 1] > a[i]:
    b.append(-1)
  elif a[i - 1] < a[i]:
    if -1 in b:
      b.append(1)
    else:
      b.append(0)
  else:
    b.append(0)
    
b.reverse()

for i in b:
  if i == 1:
    b.insert(0, 0)
    break
  elif i == -1:
    b.insert(0, 1)
    break

if len(b) != n:
  b.insert(0, 0)
    
a.reverse()
money = 1000
kabu = 0
    
for i in range(n):
  if b[i] == 1:
    kabu, money = divmod(money, a[i])
  if b[i] == -1:
    money = money + kabu * a[i]
    kabu = 0

print(money)
