n = int(input())
a = list(map(int,input().split()))
a_tmp = [a[0]]
a_new =[]
money = 1000
kabu = 0

for i in range(1,n):
  if a[i-1] != a[i]:
    a_tmp.append(a[i])

n = len(a_tmp)

if a_tmp[0] < a_tmp[1]:
  a_new.append(a_tmp[0])

for i in range(1,n-1):
  if a_tmp[i-1] >= a_tmp[i] and a_tmp[i+1] >= a_tmp[i]:
    a_new.append(a_tmp[i])
  elif a[i-1] <= a_tmp[i] and a_tmp[i+1] <= a_tmp[i]:
    a_new.append(a_tmp[i])

a_new.append(a_tmp[n-1])

if len(a_new) == 1:
  next_ = 'sale'
else:
  next_ = 'buy'
for i in range(len(a_new)):
  if next_ == 'buy':
    kabu = money // a_new[i]
    money = money % a_new[i]
    next_ = 'sale'
  else:
    money += kabu * a_new[i]
    kabu = 0
    next_ = 'buy'

print(money)