n = int(input())
a = list(map(int,input().split()))
mi_a = min(a)
start = a.index(mi_a)
if start==n-1:
  print(1000)
  exit()
money = 1000
kabu = 0
l = [min(a)]
high = 1
for i in range(start+1,n-1):
  if high==1:
    if a[i]<=a[i+1]:
      continue
    else:
      l.append(a[i])
      high = 0
  else:
    if a[i]>=a[i+1]:
      continue
    else:
      l.append(a[i])
      high = 1
if high==1 and a[-2]<a[-1]:
  l.append(a[-1])
if high==0 and a[-2]>a[-1]:
  l.append(a[-1])
#print(l)
if len(l)%2==0:
  for i in range(len(l)):
    if i%2==0:
      kabu += money//l[i]
      money -= (money//l[i])*l[i]
    else:
      money += kabu*l[i]
      kabu = 0
   # print(money,kabu)
  print(money)
else:
  l.pop()
  for i in range(len(l)):
    if i%2==0:
      kabu += money//l[i]
      money -= (money//l[i])*l[i]
    else:
      money += kabu*l[i]
      kabu = 0
    #print(money,kabu)
  print(money)