n, *a = map(int, open(0).read().split())
j = 0
k = 1000
s = []
from itertools import*
a = [i for i,_ in groupby(a)]
for i in a:
  if j==0:A=i;j=1
  elif A<i:s+=[A,i],;j=0
for A,B in s:
  k = k//A*B + k%A
print(k)